LCOV - differential code coverage report
Current view: top level - src/test/modules/oauth_validator - magic_validator.c (source / functions) Coverage Total Hit UBC CBC
Current: c70b6db34ffeab48beef1fb4ce61bcad3772b8dd vs 06473f5a344df8c9594ead90a609b86f6724cff8 Lines: 60.0 % 5 3 2 3
Current Date: 2025-09-06 07:49:51 +0900 Functions: 66.7 % 3 2 1 2
Baseline: lcov-20250906-005545-baseline Branches: 0.0 % 2 0 2
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: 60.0 % 5 3 2 3
Function coverage date bins:
(30,360] days: 66.7 % 3 2 1 2
Branch coverage date bins:
(30,360] days: 0.0 % 2 0 2

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

Generated by: LCOV version 2.4-beta