<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
ó
÷hc           @   s   d  Z  d Z y d d l Z Wn e k
 r; d d l Z n Xd d l m Z d d l m Z d e j	 f d     YZ
 e d k r e j   n  d S(	   s.   Test for google.protobuf.internal.wire_format.s#   robinson@google.com (Will Robinson)i˙˙˙˙N(   t   message(   t   wire_formatt   WireFormatTestc           B   s>   e  Z d    Z d   Z d   Z d   Z d   Z d   Z RS(   c         C   so   d } d } |  j  | d >| Bt j | |   t j } |  j t j | | d  |  j t j | | d  d  S(   Niź
  i   i   i   i˙˙˙˙(   t   assertEqualR   t   PackTagt   assertRaisesR    t   EncodeError(   t   selft   field_numbert   tag_typeR   (    (    sM   /usr/lib/python2.7/site-packages/google/protobuf/internal/wire_format_test.pyt   testPackTag/   s    	c         C   sČ   xf d	 D]^ } xU t  d  D]G } t j t j | |   \ } } |  j | |  |  j | |  q Wq W|  j t t j d   |  j t t j d  |  j t t j d  |  j t t j t    d  S(
   Ni   i   i   i˙  i   i   t   abcg        (   i   i   i   i˙  i   (	   t   rangeR   t	   UnpackTagR   R   R   t	   TypeErrort   Nonet   object(   R   t   expected_field_numbert   expected_wire_typeR   t	   wire_type(    (    sM   /usr/lib/python2.7/site-packages/google/protobuf/internal/wire_format_test.pyt   testUnpackTag:   s    c         C   s"  t  j } |  j d | d   |  j d | d   |  j d | d   |  j d | d   |  j d | d   |  j d | d	   |  j d
 | d   |  j d | d   |  j d | d   |  j t | d   |  j t | d  |  j t | d  |  j t | t    d  S(   Ni    i   i˙˙˙˙i   i   iţ˙˙˙i   l   ţ˙ i˙˙˙l   ˙˙ i   l   ţ˙˙˙ l   ˙˙˙˙ l   ˙˙˙˙ lű˙˙˙         t   abcdg        (   R   t   ZigZagEncodeR   R   R   R   R   (   R   t   Z(    (    sM   /usr/lib/python2.7/site-packages/google/protobuf/internal/wire_format_test.pyt   testZigZagEncodeH   s    	c         C   s"  t  j } |  j d | d   |  j d | d   |  j d | d   |  j d | d   |  j d | d   |  j d | d	   |  j d
 | d   |  j d | d   |  j d | d   |  j t | d   |  j t | d  |  j t | d  |  j t | t    d  S(   Ni    i˙˙˙˙i   i   iţ˙˙˙i   i   i˙˙˙l   ţ˙ i   l   ˙˙ l   ˙˙˙˙ l   ţ˙˙˙ lű˙˙˙         l   ˙˙˙˙ R   g        (   R   t   ZigZagDecodeR   R   R   R   R   (   R   R   (    (    sM   /usr/lib/python2.7/site-packages/google/protobuf/internal/wire_format_test.pyt   testZigZagDecodeY   s    	c      
   C   sf   x_ d	 d
 d d f D]K \ } } | | } | | |  } |  j  | | d | | | | | f  q Wd  S(   Ni   i   i   i   i˙  i   i   sF   byte_size_fn: %s, field_number: %d, value: %r
Expected: %d, Actual: %d(   i   i   (   i   i   (   i˙  i   (   i   i   (   R   (   R   t   byte_size_fnt   valuet   expected_value_sizeR   t	   tag_bytest   expected_sizet   actual_size(    (    sM   /usr/lib/python2.7/site-packages/google/protobuf/internal/wire_format_test.pyt   NumericByteSizeTestHelperj   s    
c      6   C   sT  t  j d d g t  j d d g t  j d d g t  j d d g t  j d d g t  j d d g t  j d d g t  j d d g t  j d d g t  j d d g t  j d d g t  j t  j d g t  j d d g t  j d d g t  j d d g t  j t  j d g t  j d d g t  j d d g t  j d d g t  j d	 d g t  j d
 d g t  j d d g t  j d d g t  j d d g t  j d d g t  j d d g t  j d	 d g t  j d
 d g t  j d d g t  j d d g t  j	 d d g t  j	 t  j d g t  j
 d d g t  j
 t  j d g t  j d d g t  j t  j d g t  j t  j d g t  j d d g t  j t  j d g t  j t  j d g t  j d d g t  j d d g t  j d d g t  j d d g t  j d d g t  j d d g t  j t d g t  j t d g t  j d d g t  j d d g t  j d d g t  j t  j d g g4 } x | D] } |  j |   q4Wxi t  j t  j f D]U } |  j d | d d   |  j d | d d   |  j d | d d d   q^W|  j d t  j d d j d    d t f d     Y} d } | d |  } |  j d | t  j d |   |  j d | t  j d |   |  j d | j t  j d |   |  j d | j t  j d |   d | _ |  j d | j t  j d |   d | _ |  j | j d t  j  d |   d | _ |  j | j d t  j  d |   |  j | j d t  j  d |   |  j! t" j# t  j d d  d  S(   Ni    i   i   i   i   i˙˙˙˙i
   i   iÁ˙˙˙i?   iŔ˙˙˙i@   i   i   g        g    eÍÍAg    eÍÍÁR   i   i   i   t   as   Đ˘ĐľŃŃs   utf-8t   MockMessagec           B   s   e  Z d    Z d   Z RS(   c         S   s   | |  _  d  S(   N(   t	   byte_size(   R   R$   (    (    sM   /usr/lib/python2.7/site-packages/google/protobuf/internal/wire_format_test.pyt   __init__Ě   s    c         S   s   |  j  S(   N(   R$   (   R   (    (    sM   /usr/lib/python2.7/site-packages/google/protobuf/internal/wire_format_test.pyt   ByteSizeÎ   s    (   t   __name__t
   __module__R%   R&   (    (    (    sM   /usr/lib/python2.7/site-packages/google/protobuf/internal/wire_format_test.pyR#   Ë   s   	R$   i   i   l	                    ($   R   t   Int32ByteSizet   Int64ByteSizet   UInt32ByteSizet
   UINT32_MAXt   UInt64ByteSizet
   UINT64_MAXt   SInt32ByteSizet   SInt64ByteSizet   Fixed32ByteSizet   Fixed64ByteSizet   SFixed32ByteSizet	   INT32_MINt	   INT32_MAXt   SFixed64ByteSizet	   INT64_MINt	   INT64_MAXt   FloatByteSizet   DoubleByteSizet   BoolByteSizet   Falset   Truet   EnumByteSizeR!   t   StringByteSizet   BytesByteSizeR   t   decodeR   t   GroupByteSizeR$   t   MessageByteSizet   MessageSetItemByteSizeR   R    R   (   R   t   NUMERIC_ARGSt   argsR   R#   t   message_byte_sizet   mock_message(    (    sM   /usr/lib/python2.7/site-packages/google/protobuf/internal/wire_format_test.pyt   testByteSizeFunctionst   s¨    !			(   R'   R(   R
   R   R   R   R!   RI   (    (    (    sM   /usr/lib/python2.7/site-packages/google/protobuf/internal/wire_format_test.pyR   -   s   					
t   __main__(   t   __doc__t
   __author__t	   unittest2t   unittestt   ImportErrort   google.protobufR    t   google.protobuf.internalR   t   TestCaseR   R'   t   main(    (    (    sM   /usr/lib/python2.7/site-packages/google/protobuf/internal/wire_format_test.pyt   <module>    s   Ň