LCOV - code coverage report
Current view: top level - Modules/_ssl/clinic - cert.c.h (source / functions) Hit Total Coverage
Test: CPython 3.12 LCOV report [commit acb105a7c1f] Lines: 15 18 83.3 %
Date: 2022-07-20 13:12:14 Functions: 2 2 100.0 %
Branches: 8 18 44.4 %

           Branch data     Line data    Source code
       1                 :            : /*[clinic input]
       2                 :            : preserve
       3                 :            : [clinic start generated code]*/
       4                 :            : 
       5                 :            : PyDoc_STRVAR(_ssl_Certificate_public_bytes__doc__,
       6                 :            : "public_bytes($self, /, format=Encoding.PEM)\n"
       7                 :            : "--\n"
       8                 :            : "\n");
       9                 :            : 
      10                 :            : #define _SSL_CERTIFICATE_PUBLIC_BYTES_METHODDEF    \
      11                 :            :     {"public_bytes", _PyCFunction_CAST(_ssl_Certificate_public_bytes), METH_FASTCALL|METH_KEYWORDS, _ssl_Certificate_public_bytes__doc__},
      12                 :            : 
      13                 :            : static PyObject *
      14                 :            : _ssl_Certificate_public_bytes_impl(PySSLCertificate *self, int format);
      15                 :            : 
      16                 :            : static PyObject *
      17                 :          2 : _ssl_Certificate_public_bytes(PySSLCertificate *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
      18                 :            : {
      19                 :          2 :     PyObject *return_value = NULL;
      20                 :            :     static const char * const _keywords[] = {"format", NULL};
      21                 :            :     static _PyArg_Parser _parser = {NULL, _keywords, "public_bytes", 0};
      22                 :            :     PyObject *argsbuf[1];
      23         [ -  + ]:          2 :     Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
      24                 :          2 :     int format = PY_SSL_ENCODING_PEM;
      25                 :            : 
      26   [ +  -  +  -  :          2 :     args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
             +  -  -  + ]
      27         [ -  + ]:          2 :     if (!args) {
      28                 :          0 :         goto exit;
      29                 :            :     }
      30         [ -  + ]:          2 :     if (!noptargs) {
      31                 :          0 :         goto skip_optional_pos;
      32                 :            :     }
      33                 :          2 :     format = _PyLong_AsInt(args[0]);
      34   [ -  +  -  - ]:          2 :     if (format == -1 && PyErr_Occurred()) {
      35                 :          0 :         goto exit;
      36                 :            :     }
      37                 :          2 : skip_optional_pos:
      38                 :          2 :     return_value = _ssl_Certificate_public_bytes_impl(self, format);
      39                 :            : 
      40                 :          2 : exit:
      41                 :          2 :     return return_value;
      42                 :            : }
      43                 :            : 
      44                 :            : PyDoc_STRVAR(_ssl_Certificate_get_info__doc__,
      45                 :            : "get_info($self, /)\n"
      46                 :            : "--\n"
      47                 :            : "\n");
      48                 :            : 
      49                 :            : #define _SSL_CERTIFICATE_GET_INFO_METHODDEF    \
      50                 :            :     {"get_info", (PyCFunction)_ssl_Certificate_get_info, METH_NOARGS, _ssl_Certificate_get_info__doc__},
      51                 :            : 
      52                 :            : static PyObject *
      53                 :            : _ssl_Certificate_get_info_impl(PySSLCertificate *self);
      54                 :            : 
      55                 :            : static PyObject *
      56                 :          2 : _ssl_Certificate_get_info(PySSLCertificate *self, PyObject *Py_UNUSED(ignored))
      57                 :            : {
      58                 :          2 :     return _ssl_Certificate_get_info_impl(self);
      59                 :            : }
      60                 :            : /*[clinic end generated code: output=18885c4d167d5244 input=a9049054013a1b77]*/

Generated by: LCOV version 1.14