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

 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                 :                : #include "utils/injection_point.h"
                                 21                 :                : 
  382 alvherre@alvh.no-ip.       22                 :CBC           1 : PG_FUNCTION_INFO_V1(test_create_multixact);
                                 23                 :              1 : PG_FUNCTION_INFO_V1(test_read_multixact);
                                 24                 :                : 
                                 25                 :                : /*
                                 26                 :                :  * Produces multixact with 2 current xids
                                 27                 :                :  */
                                 28                 :                : Datum
  382 alvherre@alvh.no-ip.       29                 :UBC           0 : test_create_multixact(PG_FUNCTION_ARGS)
                                 30                 :                : {
                                 31                 :                :     MultiXactId id;
                                 32                 :                : 
                                 33                 :              0 :     MultiXactIdSetOldestMember();
                                 34                 :              0 :     id = MultiXactIdCreate(GetCurrentTransactionId(), MultiXactStatusUpdate,
                                 35                 :                :                            GetCurrentTransactionId(), MultiXactStatusForShare);
                                 36                 :              0 :     PG_RETURN_TRANSACTIONID(id);
                                 37                 :                : }
                                 38                 :                : 
                                 39                 :                : /*
                                 40                 :                :  * Reads given multixact after running an injection point. Discards local cache
                                 41                 :                :  * to make a real read.  Tailored for multixact testing.
                                 42                 :                :  */
                                 43                 :                : Datum
                                 44                 :              0 : test_read_multixact(PG_FUNCTION_ARGS)
                                 45                 :                : {
                                 46                 :              0 :     MultiXactId id = PG_GETARG_TRANSACTIONID(0);
                                 47                 :                :     MultiXactMember *members;
                                 48                 :                : 
                                 49                 :                :     INJECTION_POINT("test-multixact-read", NULL);
                                 50                 :                :     /* discard caches */
                                 51                 :              0 :     AtEOXact_MultiXact();
                                 52                 :                : 
                                 53         [ #  # ]:              0 :     if (GetMultiXactIdMembers(id, &members, false, false) == -1)
                                 54         [ #  # ]:              0 :         elog(ERROR, "MultiXactId not found");
                                 55                 :                : 
                                 56                 :              0 :     PG_RETURN_VOID();
                                 57                 :                : }
        

Generated by: LCOV version 2.4-beta