aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/core/issue/yql_issue_ut.cpp
blob: fa8f97e63a339fcfc42322221819131e72579f09 (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
#include <library/cpp/testing/unittest/registar.h>

#include "yql_issue.h"

using namespace NYql;

Y_UNIT_TEST_SUITE(TIssuesDataTest) {
    Y_UNIT_TEST(SeverityMapTest) {
        auto severity = GetSeverity(TIssuesIds::UNEXPECTED);
        auto severityName = SeverityToString(severity);
        UNIT_ASSERT_VALUES_EQUAL(static_cast<ui32>(severity),
            static_cast<ui32>(TSeverityIds::S_FATAL));
        UNIT_ASSERT_VALUES_EQUAL(severityName, "Fatal");
    }

    Y_UNIT_TEST(UnknownSeverityNameTest) {
        auto severityName = SeverityToString(static_cast<ESeverity>(999));
        UNIT_ASSERT_VALUES_EQUAL(severityName, "Unknown");
    }

    Y_UNIT_TEST(IssueNameTest) {
        auto issueName = IssueCodeToString(TIssuesIds::DEFAULT_ERROR);
        UNIT_ASSERT_VALUES_EQUAL(issueName, "Default error");
    }

    Y_UNIT_TEST(IssueDefaultErrorNumber) {
        UNIT_ASSERT_VALUES_EQUAL((ui32)TIssuesIds::DEFAULT_ERROR, 0);
    }

}