LCOV - differential code coverage report
Current view: top level - src/test/modules/test_slru - test_multixact.c (source / functions) Coverage Total Hit UBC GBC CBC
Current: 806555e3000d0b0e0c536c1dc65548128d457d86 vs 1d325ad99cb2dec0e8b45ba36909ee0a497d2a57 Lines: 91.7 % 12 11 1 9 2
Current Date: 2025-12-17 08:58:58 +0900 Functions: 100.0 % 4 4 2 2
Baseline: lcov-20251217-005640-baseline Branches: 25.0 % 4 1 3 1
Baseline Date: 2025-12-16 12:57:12 -0800 Line coverage date bins:
Legend: Lines:     hit not hit
Branches: + taken - not taken # not executed
(360..) days: 91.7 % 12 11 1 9 2
Function coverage date bins:
(360..) days: 100.0 % 4 4 2 2
Branch coverage date bins:
(360..) days: 25.0 % 4 1 3 1

 Age         Owner                    Branch data    TLA  Line data    Source code
                                  1                 :                : /*--------------------------------------------------------------------------
                                  2                 :                :  *
                                  3                 :                :  * test_multixact.c
                                  4                 :                :  *      Support code for multixact testing
                                  5                 :                :  *
                                  6                 :                :  * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
                                  7                 :                :  * Portions Copyright (c) 1994, Regents of the University of California
                                  8                 :                :  *
                                  9                 :                :  * IDENTIFICATION
                                 10                 :                :  *      src/test/modules/test_slru/test_multixact.c
                                 11                 :                :  *
                                 12                 :                :  * -------------------------------------------------------------------------
                                 13                 :                :  */
                                 14                 :                : 
                                 15                 :                : #include "postgres.h"
                                 16                 :                : 
                                 17                 :                : #include "access/multixact.h"
                                 18                 :                : #include "access/xact.h"
                                 19                 :                : #include "fmgr.h"
                                 20                 :                : 
  484 alvherre@alvh.no-ip.       21                 :CBC          18 : PG_FUNCTION_INFO_V1(test_create_multixact);
                                 22                 :             15 : PG_FUNCTION_INFO_V1(test_read_multixact);
                                 23                 :                : 
                                 24                 :                : /*
                                 25                 :                :  * Produces multixact with 2 current xids
                                 26                 :                :  */
                                 27                 :                : Datum
  484 alvherre@alvh.no-ip.       28                 :GBC          16 : test_create_multixact(PG_FUNCTION_ARGS)
                                 29                 :                : {
                                 30                 :                :     MultiXactId id;
                                 31                 :                : 
                                 32                 :             16 :     MultiXactIdSetOldestMember();
                                 33                 :             16 :     id = MultiXactIdCreate(GetCurrentTransactionId(), MultiXactStatusUpdate,
                                 34                 :                :                            GetCurrentTransactionId(), MultiXactStatusForShare);
                                 35                 :             16 :     PG_RETURN_TRANSACTIONID(id);
                                 36                 :                : }
                                 37                 :                : 
                                 38                 :                : /*
                                 39                 :                :  * Reads given multixact.  Discards local cache to make a real read.
                                 40                 :                :  */
                                 41                 :                : Datum
                                 42                 :             13 : test_read_multixact(PG_FUNCTION_ARGS)
                                 43                 :                : {
                                 44                 :             13 :     MultiXactId id = PG_GETARG_TRANSACTIONID(0);
                                 45                 :                :     MultiXactMember *members;
                                 46                 :                : 
                                 47                 :                :     /* discard caches */
                                 48                 :             13 :     AtEOXact_MultiXact();
                                 49                 :                : 
                                 50         [ -  + ]:             13 :     if (GetMultiXactIdMembers(id, &members, false, false) == -1)
  484 alvherre@alvh.no-ip.       51         [ #  # ]:UBC           0 :         elog(ERROR, "MultiXactId not found");
                                 52                 :                : 
  484 alvherre@alvh.no-ip.       53                 :GBC          13 :     PG_RETURN_VOID();
                                 54                 :                : }
        

Generated by: LCOV version 2.4-beta