aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/parser/pg_wrapper/ut/proc_ut.cpp
blob: 6ee17c5d7d12d52c96aa0f2190574c8be955c921 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "../pg_compat.h"

extern "C" {
#include <yql/essentials/parser/pg_wrapper/postgresql/src/include/postgres.h>
#include <yql/essentials/parser/pg_wrapper/postgresql/src/include/c.h>
#include <yql/essentials/parser/pg_wrapper/postgresql/src/include/fmgr.h>
#include <yql/essentials/parser/pg_wrapper/postgresql/src/include/varatt.h>
}

#include <yql/essentials/parser/pg_catalog/catalog.h>

#include <yql/essentials/parser/pg_wrapper/utils.h>

#include <library/cpp/testing/unittest/registar.h>

namespace NYql {

Y_UNIT_TEST_SUITE(TProcTests) {
    Y_UNIT_TEST(BuiltinsHasRuntimeFuncs) {
        if (NPg::AreAllFunctionsAllowed()) {
            return;
        }
        
        NPg::EnumProc([](ui32 oid, const NPg::TProcDesc& desc) {
            if (desc.ExtensionIndex == 0 && desc.Kind == NPg::EProcKind::Function &&
                desc.Lang == NPg::LangInternal) {
                FmgrInfo finfo;
                UNIT_ASSERT(GetPgFuncAddr(oid, finfo));
                UNIT_ASSERT(finfo.fn_addr);
            }
        });
    }
}

}