LCOV - differential code coverage report
Current view: top level - src/test/modules/oauth_validator - fail_validator.c (source / functions) Coverage Total Hit UBC CBC
Current: c70b6db34ffeab48beef1fb4ce61bcad3772b8dd vs 06473f5a344df8c9594ead90a609b86f6724cff8 Lines: 100.0 % 5 5 5
Current Date: 2025-09-06 07:49:51 +0900 Functions: 100.0 % 3 3 3
Baseline: lcov-20250906-005545-baseline Branches: 50.0 % 2 1 1 1
Baseline Date: 2025-09-05 08:21:35 +0100 Line coverage date bins:
Legend: Lines:     hit not hit
Branches: + taken - not taken # not executed
(30,360] days: 100.0 % 5 5 5
Function coverage date bins:
(30,360] days: 100.0 % 3 3 3
Branch coverage date bins:
(30,360] days: 50.0 % 2 1 1 1

 Age         Owner                    Branch data    TLA  Line data    Source code
                                  1                 :                : /*-------------------------------------------------------------------------
                                  2                 :                :  *
                                  3                 :                :  * fail_validator.c
                                  4                 :                :  *    Test module for serverside OAuth token validation callbacks, which is
                                  5                 :                :  *    guaranteed to always fail in the validation callback
                                  6                 :                :  *
                                  7                 :                :  * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
                                  8                 :                :  * Portions Copyright (c) 1994, Regents of the University of California
                                  9                 :                :  *
                                 10                 :                :  * src/test/modules/oauth_validator/fail_validator.c
                                 11                 :                :  *
                                 12                 :                :  *-------------------------------------------------------------------------
                                 13                 :                :  */
                                 14                 :                : 
                                 15                 :                : #include "postgres.h"
                                 16                 :                : 
                                 17                 :                : #include "fmgr.h"
                                 18                 :                : #include "libpq/oauth.h"
                                 19                 :                : 
  198 dgustafsson@postgres       20                 :CBC           2 : PG_MODULE_MAGIC;
                                 21                 :                : 
                                 22                 :                : static bool fail_token(const ValidatorModuleState *state,
                                 23                 :                :                        const char *token,
                                 24                 :                :                        const char *role,
                                 25                 :                :                        ValidatorModuleResult *res);
                                 26                 :                : 
                                 27                 :                : /* Callback implementations (we only need the main one) */
                                 28                 :                : static const OAuthValidatorCallbacks validator_callbacks = {
                                 29                 :                :     PG_OAUTH_VALIDATOR_MAGIC,
                                 30                 :                : 
                                 31                 :                :     .validate_cb = fail_token,
                                 32                 :                : };
                                 33                 :                : 
                                 34                 :                : const OAuthValidatorCallbacks *
                                 35                 :              2 : _PG_oauth_validator_module_init(void)
                                 36                 :                : {
                                 37                 :              2 :     return &validator_callbacks;
                                 38                 :                : }
                                 39                 :                : 
                                 40                 :                : static bool
                                 41                 :              1 : fail_token(const ValidatorModuleState *state,
                                 42                 :                :            const char *token, const char *role,
                                 43                 :                :            ValidatorModuleResult *res)
                                 44                 :                : {
                                 45         [ +  - ]:              1 :     elog(FATAL, "fail_validator: sentinel error");
                                 46                 :                :     pg_unreachable();
                                 47                 :                : }
        

Generated by: LCOV version 2.4-beta