CINXE.COM

device/fido/cbor_extract_unittest.cc - chromium/src - Git at Google

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>device/fido/cbor_extract_unittest.cc - chromium/src - Git at Google</title><link rel="stylesheet" type="text/css" href="/+static/base.css"><link rel="stylesheet" type="text/css" href="/+static/prettify/prettify.css"><!-- default customHeadTagPart --></head><body class="Site"><header class="Site-header"><div class="Header"><a class="Header-image" href="/"><img src="//www.gstatic.com/images/branding/lockups/2x/lockup_git_color_108x24dp.png" width="108" height="24" alt="Google Git"></a><div class="Header-menu"> <a class="Header-menuItem" href="https://accounts.google.com/AccountChooser?faa=1&amp;service=gerritcodereview&amp;continue=https://chromium.googlesource.com/login/chromium/src/%2B/refs/tags/130.0.6723.141/device/fido/cbor_extract_unittest.cc">Sign in</a> </div></div></header><div class="Site-content"><div class="Container "><div class="Breadcrumbs"><a class="Breadcrumbs-crumb" href="/?format=HTML">chromium</a> / <a class="Breadcrumbs-crumb" href="/chromium/">chromium</a> / <a class="Breadcrumbs-crumb" href="/chromium/src/">src</a> / <a class="Breadcrumbs-crumb" href="/chromium/src/+/refs/tags/130.0.6723.141">refs/tags/130.0.6723.141</a> / <a class="Breadcrumbs-crumb" href="/chromium/src/+/refs/tags/130.0.6723.141/">.</a> / <a class="Breadcrumbs-crumb" href="/chromium/src/+/refs/tags/130.0.6723.141/device">device</a> / <a class="Breadcrumbs-crumb" href="/chromium/src/+/refs/tags/130.0.6723.141/device/fido">fido</a> / <span class="Breadcrumbs-crumb">cbor_extract_unittest.cc</span></div><div class="u-sha1 u-monospace BlobSha1">blob: b456e3e3a2581bb07aaf274df95442e701c075a3 [<a href="/chromium/src/+/refs/tags/130.0.6723.141/device/fido/cbor_extract_unittest.cc">file</a>] [<a href="/chromium/src/+log/refs/tags/130.0.6723.141/device/fido/cbor_extract_unittest.cc">log</a>] [<a href="/chromium/src/+blame/refs/tags/130.0.6723.141/device/fido/cbor_extract_unittest.cc">blame</a>]</div><table class="FileContents"><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="1"></td><td class="FileContents-lineContents" id="1"><span class="com">// Copyright 2020 The Chromium Authors</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="2"></td><td class="FileContents-lineContents" id="2"><span class="com">// Use of this source code is governed by a BSD-style license that can be</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="3"></td><td class="FileContents-lineContents" id="3"><span class="com">// found in the LICENSE file.</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="4"></td><td class="FileContents-lineContents" id="4"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="5"></td><td class="FileContents-lineContents" id="5"><span class="com">#include</span><span class="pln"> </span><span class="str">&quot;device/fido/cbor_extract.h&quot;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="6"></td><td class="FileContents-lineContents" id="6"><span class="com">#include</span><span class="pln"> </span><span class="str">&quot;base/functional/bind.h&quot;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="7"></td><td class="FileContents-lineContents" id="7"><span class="com">#include</span><span class="pln"> </span><span class="str">&quot;base/functional/callback.h&quot;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="8"></td><td class="FileContents-lineContents" id="8"><span class="com">#include</span><span class="pln"> </span><span class="str">&quot;base/memory/raw_ptr_exclusion.h&quot;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="9"></td><td class="FileContents-lineContents" id="9"><span class="com">#include</span><span class="pln"> </span><span class="str">&quot;base/ranges/algorithm.h&quot;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="10"></td><td class="FileContents-lineContents" id="10"><span class="com">#include</span><span class="pln"> </span><span class="str">&quot;components/cbor/values.h&quot;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="11"></td><td class="FileContents-lineContents" id="11"><span class="com">#include</span><span class="pln"> </span><span class="str">&quot;testing/gmock/include/gmock/gmock.h&quot;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="12"></td><td class="FileContents-lineContents" id="12"><span class="com">#include</span><span class="pln"> </span><span class="str">&quot;testing/gtest/include/gtest/gtest.h&quot;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="13"></td><td class="FileContents-lineContents" id="13"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="14"></td><td class="FileContents-lineContents" id="14"><span class="kwd">namespace</span><span class="pln"> device </span><span class="pun">{</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="15"></td><td class="FileContents-lineContents" id="15"><span class="kwd">namespace</span><span class="pln"> </span><span class="pun">{</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="16"></td><td class="FileContents-lineContents" id="16"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="17"></td><td class="FileContents-lineContents" id="17"><span class="kwd">using</span><span class="pln"> cbor_extract</span><span class="pun">::</span><span class="typ">IntKey</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="18"></td><td class="FileContents-lineContents" id="18"><span class="kwd">using</span><span class="pln"> cbor_extract</span><span class="pun">::</span><span class="typ">Is</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="19"></td><td class="FileContents-lineContents" id="19"><span class="kwd">using</span><span class="pln"> cbor_extract</span><span class="pun">::</span><span class="typ">Map</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="20"></td><td class="FileContents-lineContents" id="20"><span class="kwd">using</span><span class="pln"> cbor_extract</span><span class="pun">::</span><span class="typ">Stop</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="21"></td><td class="FileContents-lineContents" id="21"><span class="kwd">using</span><span class="pln"> cbor_extract</span><span class="pun">::</span><span class="typ">StringKey</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="22"></td><td class="FileContents-lineContents" id="22"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="23"></td><td class="FileContents-lineContents" id="23"><span class="kwd">struct</span><span class="pln"> </span><span class="typ">MakeCredRequest</span><span class="pln"> </span><span class="pun">{</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="24"></td><td class="FileContents-lineContents" id="24"><span class="pln"> </span><span class="com">// All fields below are not a raw_ptr&lt;T&gt; because cbor_extract.cc would</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="25"></td><td class="FileContents-lineContents" id="25"><span class="pln"> </span><span class="com">// cast the raw_ptr&lt;T&gt; to a void*, skipping an AddRef() call and causing a</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="26"></td><td class="FileContents-lineContents" id="26"><span class="pln"> </span><span class="com">// ref-counting mismatch.</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="27"></td><td class="FileContents-lineContents" id="27"><span class="pln"> RAW_PTR_EXCLUSION </span><span class="kwd">const</span><span class="pln"> std</span><span class="pun">::</span><span class="typ">vector</span><span class="str">&lt;uint8_t&gt;</span><span class="pun">*</span><span class="pln"> client_data_hash</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="28"></td><td class="FileContents-lineContents" id="28"><span class="pln"> RAW_PTR_EXCLUSION </span><span class="kwd">const</span><span class="pln"> std</span><span class="pun">::</span><span class="pln">string</span><span class="pun">*</span><span class="pln"> rp_id</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="29"></td><td class="FileContents-lineContents" id="29"><span class="pln"> RAW_PTR_EXCLUSION </span><span class="kwd">const</span><span class="pln"> std</span><span class="pun">::</span><span class="typ">vector</span><span class="str">&lt;uint8_t&gt;</span><span class="pun">*</span><span class="pln"> user_id</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="30"></td><td class="FileContents-lineContents" id="30"><span class="pln"> RAW_PTR_EXCLUSION </span><span class="kwd">const</span><span class="pln"> std</span><span class="pun">::</span><span class="typ">vector</span><span class="pun">&lt;</span><span class="pln">cbor</span><span class="pun">::</span><span class="typ">Value</span><span class="pun">&gt;*</span><span class="pln"> cred_params</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="31"></td><td class="FileContents-lineContents" id="31"><span class="pln"> RAW_PTR_EXCLUSION </span><span class="kwd">const</span><span class="pln"> std</span><span class="pun">::</span><span class="typ">vector</span><span class="pun">&lt;</span><span class="pln">cbor</span><span class="pun">::</span><span class="typ">Value</span><span class="pun">&gt;*</span><span class="pln"> excluded_credentials</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="32"></td><td class="FileContents-lineContents" id="32"><span class="pln"> RAW_PTR_EXCLUSION </span><span class="kwd">const</span><span class="pln"> </span><span class="kwd">bool</span><span class="pun">*</span><span class="pln"> resident_key</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="33"></td><td class="FileContents-lineContents" id="33"><span class="pln"> RAW_PTR_EXCLUSION </span><span class="kwd">const</span><span class="pln"> </span><span class="kwd">bool</span><span class="pun">*</span><span class="pln"> user_verification</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="34"></td><td class="FileContents-lineContents" id="34"><span class="pln"> RAW_PTR_EXCLUSION </span><span class="kwd">const</span><span class="pln"> </span><span class="kwd">bool</span><span class="pun">*</span><span class="pln"> large_test</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="35"></td><td class="FileContents-lineContents" id="35"><span class="pln"> RAW_PTR_EXCLUSION </span><span class="kwd">const</span><span class="pln"> </span><span class="kwd">bool</span><span class="pun">*</span><span class="pln"> negative_test</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="36"></td><td class="FileContents-lineContents" id="36"><span class="pln"> RAW_PTR_EXCLUSION </span><span class="kwd">const</span><span class="pln"> </span><span class="kwd">bool</span><span class="pun">*</span><span class="pln"> skipped_1</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="37"></td><td class="FileContents-lineContents" id="37"><span class="pln"> RAW_PTR_EXCLUSION </span><span class="kwd">const</span><span class="pln"> </span><span class="kwd">bool</span><span class="pun">*</span><span class="pln"> skipped_2</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="38"></td><td class="FileContents-lineContents" id="38"><span class="pun">};</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="39"></td><td class="FileContents-lineContents" id="39"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="40"></td><td class="FileContents-lineContents" id="40"><span class="pln">TEST</span><span class="pun">(</span><span class="typ">CBORExtract</span><span class="pun">,</span><span class="pln"> </span><span class="typ">Basic</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="41"></td><td class="FileContents-lineContents" id="41"><span class="pln"> cbor</span><span class="pun">::</span><span class="typ">Value</span><span class="pun">::</span><span class="typ">MapValue</span><span class="pln"> rp</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="42"></td><td class="FileContents-lineContents" id="42"><span class="pln"> rp</span><span class="pun">.</span><span class="pln">emplace</span><span class="pun">(</span><span class="str">&quot;id&quot;</span><span class="pun">,</span><span class="pln"> </span><span class="str">&quot;example.com&quot;</span><span class="pun">);</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="43"></td><td class="FileContents-lineContents" id="43"><span class="pln"> rp</span><span class="pun">.</span><span class="pln">emplace</span><span class="pun">(</span><span class="str">&quot;name&quot;</span><span class="pun">,</span><span class="pln"> </span><span class="str">&quot;Example&quot;</span><span class="pun">);</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="44"></td><td class="FileContents-lineContents" id="44"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="45"></td><td class="FileContents-lineContents" id="45"><span class="pln"> </span><span class="kwd">static</span><span class="pln"> </span><span class="kwd">const</span><span class="pln"> </span><span class="typ">uint8_t</span><span class="pln"> kUserId</span><span class="pun">[]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="pun">{</span><span class="lit">1</span><span class="pun">,</span><span class="pln"> </span><span class="lit">2</span><span class="pun">,</span><span class="pln"> </span><span class="lit">3</span><span class="pun">,</span><span class="pln"> </span><span class="lit">4</span><span class="pun">};</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="46"></td><td class="FileContents-lineContents" id="46"><span class="pln"> cbor</span><span class="pun">::</span><span class="typ">Value</span><span class="pun">::</span><span class="typ">MapValue</span><span class="pln"> user</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="47"></td><td class="FileContents-lineContents" id="47"><span class="pln"> user</span><span class="pun">.</span><span class="pln">emplace</span><span class="pun">(</span><span class="str">&quot;id&quot;</span><span class="pun">,</span><span class="pln"> base</span><span class="pun">::</span><span class="pln">span</span><span class="pun">&lt;</span><span class="kwd">const</span><span class="pln"> </span><span class="typ">uint8_t</span><span class="pun">&gt;(</span><span class="pln">kUserId</span><span class="pun">));</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="48"></td><td class="FileContents-lineContents" id="48"><span class="pln"> user</span><span class="pun">.</span><span class="pln">emplace</span><span class="pun">(</span><span class="str">&quot;name&quot;</span><span class="pun">,</span><span class="pln"> </span><span class="str">&quot;Joe&quot;</span><span class="pun">);</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="49"></td><td class="FileContents-lineContents" id="49"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="50"></td><td class="FileContents-lineContents" id="50"><span class="pln"> std</span><span class="pun">::</span><span class="typ">vector</span><span class="pun">&lt;</span><span class="pln">cbor</span><span class="pun">::</span><span class="typ">Value</span><span class="pun">&gt;</span><span class="pln"> cred_params</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="51"></td><td class="FileContents-lineContents" id="51"><span class="pln"> </span><span class="kwd">static</span><span class="pln"> </span><span class="kwd">const</span><span class="pln"> </span><span class="typ">int64_t</span><span class="pln"> kAlgs</span><span class="pun">[]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="pun">{-</span><span class="lit">7</span><span class="pun">,</span><span class="pln"> </span><span class="pun">-</span><span class="lit">257</span><span class="pun">};</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="52"></td><td class="FileContents-lineContents" id="52"><span class="pln"> </span><span class="kwd">for</span><span class="pln"> </span><span class="pun">(</span><span class="kwd">const</span><span class="pln"> </span><span class="typ">int64_t</span><span class="pln"> alg </span><span class="pun">:</span><span class="pln"> kAlgs</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="53"></td><td class="FileContents-lineContents" id="53"><span class="pln"> cbor</span><span class="pun">::</span><span class="typ">Value</span><span class="pun">::</span><span class="typ">MapValue</span><span class="pln"> cred_param</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="54"></td><td class="FileContents-lineContents" id="54"><span class="pln"> cred_param</span><span class="pun">.</span><span class="pln">emplace</span><span class="pun">(</span><span class="str">&quot;type&quot;</span><span class="pun">,</span><span class="pln"> </span><span class="str">&quot;public-key&quot;</span><span class="pun">);</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="55"></td><td class="FileContents-lineContents" id="55"><span class="pln"> cred_param</span><span class="pun">.</span><span class="pln">emplace</span><span class="pun">(</span><span class="str">&quot;alg&quot;</span><span class="pun">,</span><span class="pln"> alg</span><span class="pun">);</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="56"></td><td class="FileContents-lineContents" id="56"><span class="pln"> cred_params</span><span class="pun">.</span><span class="pln">emplace_back</span><span class="pun">(</span><span class="pln">std</span><span class="pun">::</span><span class="pln">move</span><span class="pun">(</span><span class="pln">cred_param</span><span class="pun">));</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="57"></td><td class="FileContents-lineContents" id="57"><span class="pln"> </span><span class="pun">}</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="58"></td><td class="FileContents-lineContents" id="58"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="59"></td><td class="FileContents-lineContents" id="59"><span class="pln"> std</span><span class="pun">::</span><span class="typ">vector</span><span class="pun">&lt;</span><span class="pln">cbor</span><span class="pun">::</span><span class="typ">Value</span><span class="pun">&gt;</span><span class="pln"> excluded_creds</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="60"></td><td class="FileContents-lineContents" id="60"><span class="pln"> </span><span class="kwd">for</span><span class="pln"> </span><span class="pun">(</span><span class="typ">int</span><span class="pln"> i </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class="pun">;</span><span class="pln"> i </span><span class="pun">&lt;</span><span class="pln"> </span><span class="lit">3</span><span class="pun">;</span><span class="pln"> i</span><span class="pun">++)</span><span class="pln"> </span><span class="pun">{</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="61"></td><td class="FileContents-lineContents" id="61"><span class="pln"> cbor</span><span class="pun">::</span><span class="typ">Value</span><span class="pun">::</span><span class="typ">MapValue</span><span class="pln"> excluded_cred</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="62"></td><td class="FileContents-lineContents" id="62"><span class="pln"> </span><span class="typ">uint8_t</span><span class="pln"> id</span><span class="pun">[</span><span class="lit">1</span><span class="pun">]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="pun">{</span><span class="kwd">static_cast</span><span class="str">&lt;uint8_t&gt;</span><span class="pun">(</span><span class="pln">i</span><span class="pun">)};</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="63"></td><td class="FileContents-lineContents" id="63"><span class="pln"> excluded_cred</span><span class="pun">.</span><span class="pln">emplace</span><span class="pun">(</span><span class="str">&quot;type&quot;</span><span class="pun">,</span><span class="pln"> </span><span class="str">&quot;public-key&quot;</span><span class="pun">);</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="64"></td><td class="FileContents-lineContents" id="64"><span class="pln"> excluded_cred</span><span class="pun">.</span><span class="pln">emplace</span><span class="pun">(</span><span class="str">&quot;id&quot;</span><span class="pun">,</span><span class="pln"> base</span><span class="pun">::</span><span class="pln">span</span><span class="pun">&lt;</span><span class="kwd">const</span><span class="pln"> </span><span class="typ">uint8_t</span><span class="pun">&gt;(</span><span class="pln">id</span><span class="pun">));</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="65"></td><td class="FileContents-lineContents" id="65"><span class="pln"> excluded_creds</span><span class="pun">.</span><span class="pln">emplace_back</span><span class="pun">(</span><span class="pln">std</span><span class="pun">::</span><span class="pln">move</span><span class="pun">(</span><span class="pln">excluded_cred</span><span class="pun">));</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="66"></td><td class="FileContents-lineContents" id="66"><span class="pln"> </span><span class="pun">}</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="67"></td><td class="FileContents-lineContents" id="67"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="68"></td><td class="FileContents-lineContents" id="68"><span class="pln"> cbor</span><span class="pun">::</span><span class="typ">Value</span><span class="pun">::</span><span class="typ">MapValue</span><span class="pln"> options</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="69"></td><td class="FileContents-lineContents" id="69"><span class="pln"> options</span><span class="pun">.</span><span class="pln">emplace</span><span class="pun">(</span><span class="str">&quot;rk&quot;</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">true</span><span class="pun">);</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="70"></td><td class="FileContents-lineContents" id="70"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="71"></td><td class="FileContents-lineContents" id="71"><span class="pln"> </span><span class="kwd">static</span><span class="pln"> </span><span class="kwd">const</span><span class="pln"> </span><span class="typ">uint8_t</span><span class="pln"> kClientDataHash</span><span class="pun">[</span><span class="lit">32</span><span class="pun">]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="pun">{</span><span class="lit">4</span><span class="pun">,</span><span class="pln"> </span><span class="lit">3</span><span class="pun">,</span><span class="pln"> </span><span class="lit">2</span><span class="pun">,</span><span class="pln"> </span><span class="lit">1</span><span class="pun">,</span><span class="pln"> </span><span class="lit">0</span><span class="pun">};</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="72"></td><td class="FileContents-lineContents" id="72"><span class="pln"> cbor</span><span class="pun">::</span><span class="typ">Value</span><span class="pun">::</span><span class="typ">MapValue</span><span class="pln"> make_cred</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="73"></td><td class="FileContents-lineContents" id="73"><span class="pln"> make_cred</span><span class="pun">.</span><span class="pln">emplace</span><span class="pun">(</span><span class="lit">1</span><span class="pun">,</span><span class="pln"> base</span><span class="pun">::</span><span class="pln">span</span><span class="pun">&lt;</span><span class="kwd">const</span><span class="pln"> </span><span class="typ">uint8_t</span><span class="pun">&gt;(</span><span class="pln">kClientDataHash</span><span class="pun">));</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="74"></td><td class="FileContents-lineContents" id="74"><span class="pln"> make_cred</span><span class="pun">.</span><span class="pln">emplace</span><span class="pun">(</span><span class="lit">2</span><span class="pun">,</span><span class="pln"> std</span><span class="pun">::</span><span class="pln">move</span><span class="pun">(</span><span class="pln">rp</span><span class="pun">));</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="75"></td><td class="FileContents-lineContents" id="75"><span class="pln"> make_cred</span><span class="pun">.</span><span class="pln">emplace</span><span class="pun">(</span><span class="lit">3</span><span class="pun">,</span><span class="pln"> std</span><span class="pun">::</span><span class="pln">move</span><span class="pun">(</span><span class="pln">user</span><span class="pun">));</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="76"></td><td class="FileContents-lineContents" id="76"><span class="pln"> make_cred</span><span class="pun">.</span><span class="pln">emplace</span><span class="pun">(</span><span class="lit">4</span><span class="pun">,</span><span class="pln"> std</span><span class="pun">::</span><span class="pln">move</span><span class="pun">(</span><span class="pln">cred_params</span><span class="pun">));</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="77"></td><td class="FileContents-lineContents" id="77"><span class="pln"> make_cred</span><span class="pun">.</span><span class="pln">emplace</span><span class="pun">(</span><span class="lit">5</span><span class="pun">,</span><span class="pln"> std</span><span class="pun">::</span><span class="pln">move</span><span class="pun">(</span><span class="pln">excluded_creds</span><span class="pun">));</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="78"></td><td class="FileContents-lineContents" id="78"><span class="pln"> make_cred</span><span class="pun">.</span><span class="pln">emplace</span><span class="pun">(</span><span class="lit">7</span><span class="pun">,</span><span class="pln"> std</span><span class="pun">::</span><span class="pln">move</span><span class="pun">(</span><span class="pln">options</span><span class="pun">));</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="79"></td><td class="FileContents-lineContents" id="79"><span class="pln"> make_cred</span><span class="pun">.</span><span class="pln">emplace</span><span class="pun">(</span><span class="lit">100</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="80"></td><td class="FileContents-lineContents" id="80"><span class="pln"> make_cred</span><span class="pun">.</span><span class="pln">emplace</span><span class="pun">(-</span><span class="lit">3</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">true</span><span class="pun">);</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="81"></td><td class="FileContents-lineContents" id="81"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="82"></td><td class="FileContents-lineContents" id="82"><span class="pln"> </span><span class="kwd">static</span><span class="pln"> </span><span class="kwd">constexpr</span><span class="pln"> cbor_extract</span><span class="pun">::</span><span class="typ">StepOrByte</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="83"></td><td class="FileContents-lineContents" id="83"><span class="pln"> kMakeCredParseSteps</span><span class="pun">[]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="pun">{</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="84"></td><td class="FileContents-lineContents" id="84"><span class="pln"> </span><span class="com">// clang-format off</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="85"></td><td class="FileContents-lineContents" id="85"><span class="pln"> ELEMENT</span><span class="pun">(</span><span class="typ">Is</span><span class="pun">::</span><span class="pln">kRequired</span><span class="pun">,</span><span class="pln"> </span><span class="typ">MakeCredRequest</span><span class="pun">,</span><span class="pln"> client_data_hash</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="86"></td><td class="FileContents-lineContents" id="86"><span class="pln"> </span><span class="typ">IntKey</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(</span><span class="lit">1</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="87"></td><td class="FileContents-lineContents" id="87"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="88"></td><td class="FileContents-lineContents" id="88"><span class="pln"> </span><span class="typ">Map</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="89"></td><td class="FileContents-lineContents" id="89"><span class="pln"> </span><span class="typ">IntKey</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(</span><span class="lit">2</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="90"></td><td class="FileContents-lineContents" id="90"><span class="pln"> ELEMENT</span><span class="pun">(</span><span class="typ">Is</span><span class="pun">::</span><span class="pln">kRequired</span><span class="pun">,</span><span class="pln"> </span><span class="typ">MakeCredRequest</span><span class="pun">,</span><span class="pln"> rp_id</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="91"></td><td class="FileContents-lineContents" id="91"><span class="pln"> </span><span class="typ">StringKey</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(),</span><span class="pln"> </span><span class="str">&#39;i&#39;</span><span class="pun">,</span><span class="pln"> </span><span class="str">&#39;d&#39;</span><span class="pun">,</span><span class="pln"> </span><span class="str">&#39;\0&#39;</span><span class="pun">,</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="92"></td><td class="FileContents-lineContents" id="92"><span class="pln"> </span><span class="typ">Stop</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="93"></td><td class="FileContents-lineContents" id="93"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="94"></td><td class="FileContents-lineContents" id="94"><span class="pln"> </span><span class="typ">Map</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="95"></td><td class="FileContents-lineContents" id="95"><span class="pln"> </span><span class="typ">IntKey</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(</span><span class="lit">3</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="96"></td><td class="FileContents-lineContents" id="96"><span class="pln"> ELEMENT</span><span class="pun">(</span><span class="typ">Is</span><span class="pun">::</span><span class="pln">kRequired</span><span class="pun">,</span><span class="pln"> </span><span class="typ">MakeCredRequest</span><span class="pun">,</span><span class="pln"> user_id</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="97"></td><td class="FileContents-lineContents" id="97"><span class="pln"> </span><span class="typ">StringKey</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(),</span><span class="pln"> </span><span class="str">&#39;i&#39;</span><span class="pun">,</span><span class="pln"> </span><span class="str">&#39;d&#39;</span><span class="pun">,</span><span class="pln"> </span><span class="str">&#39;\0&#39;</span><span class="pun">,</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="98"></td><td class="FileContents-lineContents" id="98"><span class="pln"> </span><span class="typ">Stop</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="99"></td><td class="FileContents-lineContents" id="99"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="100"></td><td class="FileContents-lineContents" id="100"><span class="pln"> ELEMENT</span><span class="pun">(</span><span class="typ">Is</span><span class="pun">::</span><span class="pln">kRequired</span><span class="pun">,</span><span class="pln"> </span><span class="typ">MakeCredRequest</span><span class="pun">,</span><span class="pln"> cred_params</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="101"></td><td class="FileContents-lineContents" id="101"><span class="pln"> </span><span class="typ">IntKey</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(</span><span class="lit">4</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="102"></td><td class="FileContents-lineContents" id="102"><span class="pln"> ELEMENT</span><span class="pun">(</span><span class="typ">Is</span><span class="pun">::</span><span class="pln">kRequired</span><span class="pun">,</span><span class="pln"> </span><span class="typ">MakeCredRequest</span><span class="pun">,</span><span class="pln"> excluded_credentials</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="103"></td><td class="FileContents-lineContents" id="103"><span class="pln"> </span><span class="typ">IntKey</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(</span><span class="lit">5</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="104"></td><td class="FileContents-lineContents" id="104"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="105"></td><td class="FileContents-lineContents" id="105"><span class="pln"> </span><span class="typ">Map</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="106"></td><td class="FileContents-lineContents" id="106"><span class="pln"> </span><span class="typ">IntKey</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(</span><span class="lit">7</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="107"></td><td class="FileContents-lineContents" id="107"><span class="pln"> ELEMENT</span><span class="pun">(</span><span class="typ">Is</span><span class="pun">::</span><span class="pln">kOptional</span><span class="pun">,</span><span class="pln"> </span><span class="typ">MakeCredRequest</span><span class="pun">,</span><span class="pln"> resident_key</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="108"></td><td class="FileContents-lineContents" id="108"><span class="pln"> </span><span class="typ">StringKey</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(),</span><span class="pln"> </span><span class="str">&#39;r&#39;</span><span class="pun">,</span><span class="pln"> </span><span class="str">&#39;k&#39;</span><span class="pun">,</span><span class="pln"> </span><span class="str">&#39;\0&#39;</span><span class="pun">,</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="109"></td><td class="FileContents-lineContents" id="109"><span class="pln"> ELEMENT</span><span class="pun">(</span><span class="typ">Is</span><span class="pun">::</span><span class="pln">kOptional</span><span class="pun">,</span><span class="pln"> </span><span class="typ">MakeCredRequest</span><span class="pun">,</span><span class="pln"> user_verification</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="110"></td><td class="FileContents-lineContents" id="110"><span class="pln"> </span><span class="typ">StringKey</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(),</span><span class="pln"> </span><span class="str">&#39;u&#39;</span><span class="pun">,</span><span class="pln"> </span><span class="str">&#39;v&#39;</span><span class="pun">,</span><span class="pln"> </span><span class="str">&#39;\0&#39;</span><span class="pun">,</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="111"></td><td class="FileContents-lineContents" id="111"><span class="pln"> </span><span class="typ">Stop</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="112"></td><td class="FileContents-lineContents" id="112"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="113"></td><td class="FileContents-lineContents" id="113"><span class="pln"> </span><span class="com">// This map doesn&#39;t exist in the CBOR. It&#39;s optional, so that should be</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="114"></td><td class="FileContents-lineContents" id="114"><span class="pln"> </span><span class="com">// fine.</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="115"></td><td class="FileContents-lineContents" id="115"><span class="pln"> </span><span class="typ">Map</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(</span><span class="typ">Is</span><span class="pun">::</span><span class="pln">kOptional</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="116"></td><td class="FileContents-lineContents" id="116"><span class="pln"> </span><span class="typ">IntKey</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(</span><span class="lit">8</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="117"></td><td class="FileContents-lineContents" id="117"><span class="pln"> </span><span class="typ">Map</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(</span><span class="typ">Is</span><span class="pun">::</span><span class="pln">kRequired</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="118"></td><td class="FileContents-lineContents" id="118"><span class="pln"> </span><span class="typ">IntKey</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(</span><span class="lit">1</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="119"></td><td class="FileContents-lineContents" id="119"><span class="pln"> ELEMENT</span><span class="pun">(</span><span class="typ">Is</span><span class="pun">::</span><span class="pln">kRequired</span><span class="pun">,</span><span class="pln"> </span><span class="typ">MakeCredRequest</span><span class="pun">,</span><span class="pln"> skipped_1</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="120"></td><td class="FileContents-lineContents" id="120"><span class="pln"> </span><span class="typ">StringKey</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(),</span><span class="pln"> </span><span class="str">&#39;t&#39;</span><span class="pun">,</span><span class="pln"> </span><span class="str">&#39;e&#39;</span><span class="pun">,</span><span class="pln"> </span><span class="str">&#39;s&#39;</span><span class="pun">,</span><span class="pln"> </span><span class="str">&#39;t&#39;</span><span class="pun">,</span><span class="pln"> </span><span class="str">&#39;\0&#39;</span><span class="pun">,</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="121"></td><td class="FileContents-lineContents" id="121"><span class="pln"> </span><span class="typ">Stop</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="122"></td><td class="FileContents-lineContents" id="122"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="123"></td><td class="FileContents-lineContents" id="123"><span class="pln"> ELEMENT</span><span class="pun">(</span><span class="typ">Is</span><span class="pun">::</span><span class="pln">kRequired</span><span class="pun">,</span><span class="pln"> </span><span class="typ">MakeCredRequest</span><span class="pun">,</span><span class="pln"> skipped_2</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="124"></td><td class="FileContents-lineContents" id="124"><span class="pln"> </span><span class="typ">IntKey</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(</span><span class="lit">1</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="125"></td><td class="FileContents-lineContents" id="125"><span class="pln"> </span><span class="typ">Stop</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="126"></td><td class="FileContents-lineContents" id="126"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="127"></td><td class="FileContents-lineContents" id="127"><span class="pln"> ELEMENT</span><span class="pun">(</span><span class="typ">Is</span><span class="pun">::</span><span class="pln">kRequired</span><span class="pun">,</span><span class="pln"> </span><span class="typ">MakeCredRequest</span><span class="pun">,</span><span class="pln"> large_test</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="128"></td><td class="FileContents-lineContents" id="128"><span class="pln"> </span><span class="typ">IntKey</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(</span><span class="lit">100</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="129"></td><td class="FileContents-lineContents" id="129"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="130"></td><td class="FileContents-lineContents" id="130"><span class="pln"> ELEMENT</span><span class="pun">(</span><span class="typ">Is</span><span class="pun">::</span><span class="pln">kRequired</span><span class="pun">,</span><span class="pln"> </span><span class="typ">MakeCredRequest</span><span class="pun">,</span><span class="pln"> negative_test</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="131"></td><td class="FileContents-lineContents" id="131"><span class="pln"> </span><span class="typ">IntKey</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(-</span><span class="lit">3</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="132"></td><td class="FileContents-lineContents" id="132"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="133"></td><td class="FileContents-lineContents" id="133"><span class="pln"> </span><span class="typ">Stop</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="134"></td><td class="FileContents-lineContents" id="134"><span class="pln"> </span><span class="com">// clang-format on</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="135"></td><td class="FileContents-lineContents" id="135"><span class="pln"> </span><span class="pun">};</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="136"></td><td class="FileContents-lineContents" id="136"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="137"></td><td class="FileContents-lineContents" id="137"><span class="pln"> </span><span class="typ">MakeCredRequest</span><span class="pln"> make_cred_request</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="138"></td><td class="FileContents-lineContents" id="138"><span class="pln"> ASSERT_TRUE</span><span class="pun">(</span><span class="pln">cbor_extract</span><span class="pun">::</span><span class="typ">Extract</span><span class="pun">&lt;</span><span class="typ">MakeCredRequest</span><span class="pun">&gt;(</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="139"></td><td class="FileContents-lineContents" id="139"><span class="pln"> </span><span class="pun">&amp;</span><span class="pln">make_cred_request</span><span class="pun">,</span><span class="pln"> kMakeCredParseSteps</span><span class="pun">,</span><span class="pln"> make_cred</span><span class="pun">));</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="140"></td><td class="FileContents-lineContents" id="140"><span class="pln"> EXPECT_TRUE</span><span class="pun">(</span><span class="pln">base</span><span class="pun">::</span><span class="pln">ranges</span><span class="pun">::</span><span class="pln">equal</span><span class="pun">(*</span><span class="pln">make_cred_request</span><span class="pun">.</span><span class="pln">client_data_hash</span><span class="pun">,</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="141"></td><td class="FileContents-lineContents" id="141"><span class="pln"> kClientDataHash</span><span class="pun">));</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="142"></td><td class="FileContents-lineContents" id="142"><span class="pln"> EXPECT_EQ</span><span class="pun">(*</span><span class="pln">make_cred_request</span><span class="pun">.</span><span class="pln">rp_id</span><span class="pun">,</span><span class="pln"> </span><span class="str">&quot;example.com&quot;</span><span class="pun">);</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="143"></td><td class="FileContents-lineContents" id="143"><span class="pln"> EXPECT_TRUE</span><span class="pun">(</span><span class="pln">base</span><span class="pun">::</span><span class="pln">ranges</span><span class="pun">::</span><span class="pln">equal</span><span class="pun">(*</span><span class="pln">make_cred_request</span><span class="pun">.</span><span class="pln">user_id</span><span class="pun">,</span><span class="pln"> kUserId</span><span class="pun">));</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="144"></td><td class="FileContents-lineContents" id="144"><span class="pln"> EXPECT_EQ</span><span class="pun">(</span><span class="pln">make_cred_request</span><span class="pun">.</span><span class="pln">cred_params</span><span class="pun">-&gt;</span><span class="pln">size</span><span class="pun">(),</span><span class="pln"> </span><span class="lit">2u</span><span class="pun">);</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="145"></td><td class="FileContents-lineContents" id="145"><span class="pln"> EXPECT_EQ</span><span class="pun">(</span><span class="pln">make_cred_request</span><span class="pun">.</span><span class="pln">excluded_credentials</span><span class="pun">-&gt;</span><span class="pln">size</span><span class="pun">(),</span><span class="pln"> </span><span class="lit">3u</span><span class="pun">);</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="146"></td><td class="FileContents-lineContents" id="146"><span class="pln"> EXPECT_TRUE</span><span class="pun">(*</span><span class="pln">make_cred_request</span><span class="pun">.</span><span class="pln">resident_key</span><span class="pun">);</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="147"></td><td class="FileContents-lineContents" id="147"><span class="pln"> EXPECT_TRUE</span><span class="pun">(</span><span class="pln">make_cred_request</span><span class="pun">.</span><span class="pln">user_verification </span><span class="pun">==</span><span class="pln"> </span><span class="kwd">nullptr</span><span class="pun">);</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="148"></td><td class="FileContents-lineContents" id="148"><span class="pln"> EXPECT_FALSE</span><span class="pun">(*</span><span class="pln">make_cred_request</span><span class="pun">.</span><span class="pln">large_test</span><span class="pun">);</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="149"></td><td class="FileContents-lineContents" id="149"><span class="pln"> EXPECT_TRUE</span><span class="pun">(*</span><span class="pln">make_cred_request</span><span class="pun">.</span><span class="pln">negative_test</span><span class="pun">);</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="150"></td><td class="FileContents-lineContents" id="150"><span class="pln"> EXPECT_EQ</span><span class="pun">(</span><span class="pln">make_cred_request</span><span class="pun">.</span><span class="pln">skipped_1</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">nullptr</span><span class="pun">);</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="151"></td><td class="FileContents-lineContents" id="151"><span class="pln"> EXPECT_EQ</span><span class="pun">(</span><span class="pln">make_cred_request</span><span class="pun">.</span><span class="pln">skipped_2</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">nullptr</span><span class="pun">);</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="152"></td><td class="FileContents-lineContents" id="152"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="153"></td><td class="FileContents-lineContents" id="153"><span class="pln"> std</span><span class="pun">::</span><span class="typ">vector</span><span class="str">&lt;int64_t&gt;</span><span class="pln"> algs</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="154"></td><td class="FileContents-lineContents" id="154"><span class="pln"> EXPECT_TRUE</span><span class="pun">(</span><span class="pln">cbor_extract</span><span class="pun">::</span><span class="typ">ForEachPublicKeyEntry</span><span class="pun">(</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="155"></td><td class="FileContents-lineContents" id="155"><span class="pln"> </span><span class="pun">*</span><span class="pln">make_cred_request</span><span class="pun">.</span><span class="pln">cred_params</span><span class="pun">,</span><span class="pln"> cbor</span><span class="pun">::</span><span class="typ">Value</span><span class="pun">(</span><span class="str">&quot;alg&quot;</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="156"></td><td class="FileContents-lineContents" id="156"><span class="pln"> base</span><span class="pun">::</span><span class="typ">BindRepeating</span><span class="pun">(</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="157"></td><td class="FileContents-lineContents" id="157"><span class="pln"> </span><span class="pun">[](</span><span class="pln">std</span><span class="pun">::</span><span class="typ">vector</span><span class="str">&lt;int64_t&gt;</span><span class="pun">*</span><span class="pln"> out</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">const</span><span class="pln"> cbor</span><span class="pun">::</span><span class="typ">Value</span><span class="pun">&amp;</span><span class="pln"> value</span><span class="pun">)</span><span class="pln"> </span><span class="pun">-&gt;</span><span class="pln"> </span><span class="kwd">bool</span><span class="pln"> </span><span class="pun">{</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="158"></td><td class="FileContents-lineContents" id="158"><span class="pln"> </span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(!</span><span class="pln">value</span><span class="pun">.</span><span class="pln">is_integer</span><span class="pun">())</span><span class="pln"> </span><span class="pun">{</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="159"></td><td class="FileContents-lineContents" id="159"><span class="pln"> </span><span class="kwd">return</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="160"></td><td class="FileContents-lineContents" id="160"><span class="pln"> </span><span class="pun">}</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="161"></td><td class="FileContents-lineContents" id="161"><span class="pln"> out</span><span class="pun">-&gt;</span><span class="pln">push_back</span><span class="pun">(</span><span class="pln">value</span><span class="pun">.</span><span class="typ">GetInteger</span><span class="pun">());</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="162"></td><td class="FileContents-lineContents" id="162"><span class="pln"> </span><span class="kwd">return</span><span class="pln"> </span><span class="kwd">true</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="163"></td><td class="FileContents-lineContents" id="163"><span class="pln"> </span><span class="pun">},</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="164"></td><td class="FileContents-lineContents" id="164"><span class="pln"> base</span><span class="pun">::</span><span class="typ">Unretained</span><span class="pun">(&amp;</span><span class="pln">algs</span><span class="pun">))));</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="165"></td><td class="FileContents-lineContents" id="165"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="166"></td><td class="FileContents-lineContents" id="166"><span class="pln"> EXPECT_TRUE</span><span class="pun">(</span><span class="pln">base</span><span class="pun">::</span><span class="pln">ranges</span><span class="pun">::</span><span class="pln">equal</span><span class="pun">(</span><span class="pln">algs</span><span class="pun">,</span><span class="pln"> kAlgs</span><span class="pun">));</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="167"></td><td class="FileContents-lineContents" id="167"><span class="pun">}</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="168"></td><td class="FileContents-lineContents" id="168"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="169"></td><td class="FileContents-lineContents" id="169"><span class="pln">TEST</span><span class="pun">(</span><span class="typ">CBORExtract</span><span class="pun">,</span><span class="pln"> </span><span class="typ">MissingRequired</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="170"></td><td class="FileContents-lineContents" id="170"><span class="pln"> </span><span class="kwd">struct</span><span class="pln"> </span><span class="typ">Dummy</span><span class="pln"> </span><span class="pun">{</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="171"></td><td class="FileContents-lineContents" id="171"><span class="pln"> </span><span class="com">// This field is not a raw_ptr&lt;&gt; because ELEMENT() treats the raw_ptr&lt;T&gt; as</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="172"></td><td class="FileContents-lineContents" id="172"><span class="pln"> </span><span class="com">// a void*.</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="173"></td><td class="FileContents-lineContents" id="173"><span class="pln"> RAW_PTR_EXCLUSION </span><span class="kwd">const</span><span class="pln"> </span><span class="typ">int64_t</span><span class="pun">*</span><span class="pln"> value</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="174"></td><td class="FileContents-lineContents" id="174"><span class="pln"> </span><span class="pun">};</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="175"></td><td class="FileContents-lineContents" id="175"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="176"></td><td class="FileContents-lineContents" id="176"><span class="pln"> </span><span class="kwd">static</span><span class="pln"> </span><span class="kwd">constexpr</span><span class="pln"> cbor_extract</span><span class="pun">::</span><span class="typ">StepOrByte</span><span class="pun">&lt;</span><span class="typ">Dummy</span><span class="pun">&gt;</span><span class="pln"> kSteps</span><span class="pun">[]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="pun">{</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="177"></td><td class="FileContents-lineContents" id="177"><span class="pln"> ELEMENT</span><span class="pun">(</span><span class="typ">Is</span><span class="pun">::</span><span class="pln">kRequired</span><span class="pun">,</span><span class="pln"> </span><span class="typ">Dummy</span><span class="pun">,</span><span class="pln"> value</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="178"></td><td class="FileContents-lineContents" id="178"><span class="pln"> </span><span class="typ">IntKey</span><span class="pun">&lt;</span><span class="typ">Dummy</span><span class="pun">&gt;(</span><span class="lit">1</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="179"></td><td class="FileContents-lineContents" id="179"><span class="pln"> </span><span class="typ">Stop</span><span class="pun">&lt;</span><span class="typ">Dummy</span><span class="pun">&gt;(),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="180"></td><td class="FileContents-lineContents" id="180"><span class="pln"> </span><span class="pun">};</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="181"></td><td class="FileContents-lineContents" id="181"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="182"></td><td class="FileContents-lineContents" id="182"><span class="pln"> cbor</span><span class="pun">::</span><span class="typ">Value</span><span class="pun">::</span><span class="typ">MapValue</span><span class="pln"> </span><span class="typ">map</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="183"></td><td class="FileContents-lineContents" id="183"><span class="pln"> </span><span class="typ">Dummy</span><span class="pln"> dummy</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="184"></td><td class="FileContents-lineContents" id="184"><span class="pln"> EXPECT_FALSE</span><span class="pun">(</span><span class="pln">cbor_extract</span><span class="pun">::</span><span class="typ">Extract</span><span class="pun">&lt;</span><span class="typ">Dummy</span><span class="pun">&gt;(&amp;</span><span class="pln">dummy</span><span class="pun">,</span><span class="pln"> kSteps</span><span class="pun">,</span><span class="pln"> </span><span class="typ">map</span><span class="pun">));</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="185"></td><td class="FileContents-lineContents" id="185"><span class="pun">}</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="186"></td><td class="FileContents-lineContents" id="186"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="187"></td><td class="FileContents-lineContents" id="187"><span class="pln">TEST</span><span class="pun">(</span><span class="typ">CBORExtract</span><span class="pun">,</span><span class="pln"> </span><span class="typ">WrongType</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="188"></td><td class="FileContents-lineContents" id="188"><span class="pln"> </span><span class="kwd">struct</span><span class="pln"> </span><span class="typ">Dummy</span><span class="pln"> </span><span class="pun">{</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="189"></td><td class="FileContents-lineContents" id="189"><span class="pln"> </span><span class="com">// This field is not a raw_ptr&lt;&gt; because ELEMENT() treats the raw_ptr&lt;T&gt; as</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="190"></td><td class="FileContents-lineContents" id="190"><span class="pln"> </span><span class="com">// a void*.</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="191"></td><td class="FileContents-lineContents" id="191"><span class="pln"> RAW_PTR_EXCLUSION </span><span class="kwd">const</span><span class="pln"> </span><span class="typ">int64_t</span><span class="pun">*</span><span class="pln"> value</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="192"></td><td class="FileContents-lineContents" id="192"><span class="pln"> </span><span class="pun">};</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="193"></td><td class="FileContents-lineContents" id="193"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="194"></td><td class="FileContents-lineContents" id="194"><span class="pln"> </span><span class="kwd">static</span><span class="pln"> </span><span class="kwd">constexpr</span><span class="pln"> cbor_extract</span><span class="pun">::</span><span class="typ">StepOrByte</span><span class="pun">&lt;</span><span class="typ">Dummy</span><span class="pun">&gt;</span><span class="pln"> kSteps</span><span class="pun">[]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="pun">{</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="195"></td><td class="FileContents-lineContents" id="195"><span class="pln"> ELEMENT</span><span class="pun">(</span><span class="typ">Is</span><span class="pun">::</span><span class="pln">kRequired</span><span class="pun">,</span><span class="pln"> </span><span class="typ">Dummy</span><span class="pun">,</span><span class="pln"> value</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="196"></td><td class="FileContents-lineContents" id="196"><span class="pln"> </span><span class="typ">IntKey</span><span class="pun">&lt;</span><span class="typ">Dummy</span><span class="pun">&gt;(</span><span class="lit">1</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="197"></td><td class="FileContents-lineContents" id="197"><span class="pln"> </span><span class="typ">Stop</span><span class="pun">&lt;</span><span class="typ">Dummy</span><span class="pun">&gt;(),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="198"></td><td class="FileContents-lineContents" id="198"><span class="pln"> </span><span class="pun">};</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="199"></td><td class="FileContents-lineContents" id="199"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="200"></td><td class="FileContents-lineContents" id="200"><span class="pln"> cbor</span><span class="pun">::</span><span class="typ">Value</span><span class="pun">::</span><span class="typ">MapValue</span><span class="pln"> </span><span class="typ">map</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="201"></td><td class="FileContents-lineContents" id="201"><span class="pln"> </span><span class="typ">map</span><span class="pun">.</span><span class="pln">emplace</span><span class="pun">(</span><span class="lit">1</span><span class="pun">,</span><span class="pln"> </span><span class="str">&quot;string&quot;</span><span class="pun">);</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="202"></td><td class="FileContents-lineContents" id="202"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="203"></td><td class="FileContents-lineContents" id="203"><span class="pln"> </span><span class="typ">Dummy</span><span class="pln"> dummy</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="204"></td><td class="FileContents-lineContents" id="204"><span class="pln"> EXPECT_FALSE</span><span class="pun">(</span><span class="pln">cbor_extract</span><span class="pun">::</span><span class="typ">Extract</span><span class="pun">&lt;</span><span class="typ">Dummy</span><span class="pun">&gt;(&amp;</span><span class="pln">dummy</span><span class="pun">,</span><span class="pln"> kSteps</span><span class="pun">,</span><span class="pln"> </span><span class="typ">map</span><span class="pun">));</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="205"></td><td class="FileContents-lineContents" id="205"><span class="pun">}</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="206"></td><td class="FileContents-lineContents" id="206"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="207"></td><td class="FileContents-lineContents" id="207"><span class="pln">TEST</span><span class="pun">(</span><span class="typ">CBORExtract</span><span class="pun">,</span><span class="pln"> </span><span class="typ">RequiredInOptionalMap</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="208"></td><td class="FileContents-lineContents" id="208"><span class="pln"> </span><span class="kwd">struct</span><span class="pln"> </span><span class="typ">Dummy</span><span class="pln"> </span><span class="pun">{</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="209"></td><td class="FileContents-lineContents" id="209"><span class="pln"> </span><span class="com">// This field is not a raw_ptr&lt;&gt; because ELEMENT() treats the raw_ptr&lt;T&gt; as</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="210"></td><td class="FileContents-lineContents" id="210"><span class="pln"> </span><span class="com">// a void*.</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="211"></td><td class="FileContents-lineContents" id="211"><span class="pln"> RAW_PTR_EXCLUSION </span><span class="kwd">const</span><span class="pln"> </span><span class="typ">int64_t</span><span class="pun">*</span><span class="pln"> value</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="212"></td><td class="FileContents-lineContents" id="212"><span class="pln"> </span><span class="pun">};</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="213"></td><td class="FileContents-lineContents" id="213"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="214"></td><td class="FileContents-lineContents" id="214"><span class="pln"> </span><span class="kwd">static</span><span class="pln"> </span><span class="kwd">constexpr</span><span class="pln"> cbor_extract</span><span class="pun">::</span><span class="typ">StepOrByte</span><span class="pun">&lt;</span><span class="typ">Dummy</span><span class="pun">&gt;</span><span class="pln"> kSteps</span><span class="pun">[]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="pun">{</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="215"></td><td class="FileContents-lineContents" id="215"><span class="pln"> </span><span class="com">// clang-format off</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="216"></td><td class="FileContents-lineContents" id="216"><span class="pln"> </span><span class="typ">Map</span><span class="pun">&lt;</span><span class="typ">Dummy</span><span class="pun">&gt;(</span><span class="typ">Is</span><span class="pun">::</span><span class="pln">kOptional</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="217"></td><td class="FileContents-lineContents" id="217"><span class="pln"> </span><span class="typ">IntKey</span><span class="pun">&lt;</span><span class="typ">Dummy</span><span class="pun">&gt;(</span><span class="lit">1</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="218"></td><td class="FileContents-lineContents" id="218"><span class="pln"> ELEMENT</span><span class="pun">(</span><span class="typ">Is</span><span class="pun">::</span><span class="pln">kRequired</span><span class="pun">,</span><span class="pln"> </span><span class="typ">Dummy</span><span class="pun">,</span><span class="pln"> value</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="219"></td><td class="FileContents-lineContents" id="219"><span class="pln"> </span><span class="typ">IntKey</span><span class="pun">&lt;</span><span class="typ">Dummy</span><span class="pun">&gt;(</span><span class="lit">1</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="220"></td><td class="FileContents-lineContents" id="220"><span class="pln"> </span><span class="typ">Stop</span><span class="pun">&lt;</span><span class="typ">Dummy</span><span class="pun">&gt;(),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="221"></td><td class="FileContents-lineContents" id="221"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="222"></td><td class="FileContents-lineContents" id="222"><span class="pln"> </span><span class="typ">Stop</span><span class="pun">&lt;</span><span class="typ">Dummy</span><span class="pun">&gt;(),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="223"></td><td class="FileContents-lineContents" id="223"><span class="pln"> </span><span class="com">// clang-format on</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="224"></td><td class="FileContents-lineContents" id="224"><span class="pln"> </span><span class="pun">};</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="225"></td><td class="FileContents-lineContents" id="225"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="226"></td><td class="FileContents-lineContents" id="226"><span class="pln"> </span><span class="kwd">for</span><span class="pln"> </span><span class="pun">(</span><span class="kwd">const</span><span class="pln"> </span><span class="kwd">bool</span><span class="pln"> required_field_present </span><span class="pun">:</span><span class="pln"> </span><span class="pun">{</span><span class="kwd">false</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">true</span><span class="pun">})</span><span class="pln"> </span><span class="pun">{</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="227"></td><td class="FileContents-lineContents" id="227"><span class="pln"> cbor</span><span class="pun">::</span><span class="typ">Value</span><span class="pun">::</span><span class="typ">MapValue</span><span class="pln"> sub_map</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="228"></td><td class="FileContents-lineContents" id="228"><span class="pln"> </span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(</span><span class="pln">required_field_present</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="229"></td><td class="FileContents-lineContents" id="229"><span class="pln"> sub_map</span><span class="pun">.</span><span class="pln">emplace</span><span class="pun">(</span><span class="lit">1</span><span class="pun">,</span><span class="pln"> </span><span class="lit">1</span><span class="pun">);</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="230"></td><td class="FileContents-lineContents" id="230"><span class="pln"> </span><span class="pun">}</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="231"></td><td class="FileContents-lineContents" id="231"><span class="pln"> cbor</span><span class="pun">::</span><span class="typ">Value</span><span class="pun">::</span><span class="typ">MapValue</span><span class="pln"> </span><span class="typ">map</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="232"></td><td class="FileContents-lineContents" id="232"><span class="pln"> </span><span class="typ">map</span><span class="pun">.</span><span class="pln">emplace</span><span class="pun">(</span><span class="lit">1</span><span class="pun">,</span><span class="pln"> std</span><span class="pun">::</span><span class="pln">move</span><span class="pun">(</span><span class="pln">sub_map</span><span class="pun">));</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="233"></td><td class="FileContents-lineContents" id="233"><span class="pln"> </span><span class="typ">Dummy</span><span class="pln"> dummy</span><span class="pun">;</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="234"></td><td class="FileContents-lineContents" id="234"><span class="pln"> EXPECT_EQ</span><span class="pun">(</span><span class="pln">cbor_extract</span><span class="pun">::</span><span class="typ">Extract</span><span class="pun">&lt;</span><span class="typ">Dummy</span><span class="pun">&gt;(&amp;</span><span class="pln">dummy</span><span class="pun">,</span><span class="pln"> kSteps</span><span class="pun">,</span><span class="pln"> </span><span class="typ">map</span><span class="pun">),</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="235"></td><td class="FileContents-lineContents" id="235"><span class="pln"> required_field_present</span><span class="pun">);</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="236"></td><td class="FileContents-lineContents" id="236"><span class="pln"> </span><span class="pun">}</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="237"></td><td class="FileContents-lineContents" id="237"><span class="pun">}</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="238"></td><td class="FileContents-lineContents" id="238"></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="239"></td><td class="FileContents-lineContents" id="239"><span class="pun">}</span><span class="pln"> </span><span class="com">// namespace</span></td></tr><tr class="u-pre u-monospace FileContents-line"><td class="u-lineNum u-noSelect FileContents-lineNum" data-line-number="240"></td><td class="FileContents-lineContents" id="240"><span class="pun">}</span><span class="pln"> </span><span class="com">// namespace device</span></td></tr></table><script nonce="wcqNnyGapqrC23dcPWcExw">for (let lineNumEl of document.querySelectorAll('td.u-lineNum')) {lineNumEl.onclick = () => {window.location.hash = `#${lineNumEl.getAttribute('data-line-number')}`;};}</script></div> <!-- Container --></div> <!-- Site-content --><footer class="Site-footer"><div class="Footer"><span class="Footer-poweredBy">Powered by <a href="https://gerrit.googlesource.com/gitiles/">Gitiles</a>| <a href="https://policies.google.com/privacy">Privacy</a>| <a href="https://policies.google.com/terms">Terms</a></span><span class="Footer-formats"><a class="u-monospace Footer-formatsItem" href="?format=TEXT">txt</a> <a class="u-monospace Footer-formatsItem" href="?format=JSON">json</a></span></div></footer></body></html>

Pages: 1 2 3 4 5 6 7 8 9 10