Coverage Report

Created: 2026-10-31 06:47

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/quantlib/ql/time/calendars/northmacedonia.cpp
Line
Count
Source
1
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3
/*
4
 Copyright (C) 2026 SoftSolution srl
5
6
 This file is part of QuantLib, a free-software/open-source library
7
 for financial quantitative analysts and developers - http://quantlib.org/
8
9
 QuantLib is free software: you can redistribute it and/or modify it
10
 under the terms of the QuantLib license.  You should have received a
11
 copy of the license along with this program; if not, please email
12
 <quantlib-dev@lists.sf.net>. The license is also available online at
13
 <https://www.quantlib.org/license.shtml>.
14
15
 This program is distributed in the hope that it will be useful, but WITHOUT
16
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17
 FOR A PARTICULAR PURPOSE.  See the license for more details.
18
*/
19
20
#include <ql/time/calendars/islamicholidays.hpp>
21
#include <ql/time/calendars/northmacedonia.hpp>
22
23
namespace QuantLib {
24
25
0
    NorthMacedonia::NorthMacedonia(Market) {
26
0
        static ext::shared_ptr<Calendar::Impl> impl(new NorthMacedonia::MseImpl);
27
0
        impl_ = impl;
28
0
    }
29
30
0
    bool NorthMacedonia::MseImpl::isBusinessDay(const Date& date) const {
31
0
        Weekday w = date.weekday();
32
0
        Day d = date.dayOfMonth(), dd = date.dayOfYear();
33
0
        Month m = date.month();
34
0
        Year y = date.year();
35
0
        Day em = easterMonday(y);
36
37
0
        if (isWeekend(w)
38
0
            || MoonSightingMethod::isEidAlFitr(date)
39
0
            || MoonSightingMethod::isEidAlAdha(date)
40
            // New Year
41
0
            || (d == 1 && m == January)
42
            // Orthodox Christmas
43
0
            || (d == 7 && m == January)
44
            // Easter Monday
45
0
            || (dd == em)
46
            // Labour Day
47
0
            || (d == 1 && m == May)
48
            // Saints Cyril and Methodius Day
49
0
            || (d == 24 && m == May)
50
            // Republic Day
51
0
            || (d == 2 && m == August)
52
            // Independence Day
53
0
            || (d == 8 && m == September)
54
            // Day of People’s Uprising
55
0
            || (d == 11 && m == October)
56
            // Day of the Macedonian Revolutionary Struggle
57
0
            || (d == 23 && m == October)
58
            // Saint Clement of Ohrid Day,
59
0
            || (d == 8 && m == December))
60
0
            return false;
61
0
        return true;
62
0
    }
63
64
}