aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/libsample/oddbool.cpp
blob: 06a61f1c2b727bb689f3118405e814e693c9cb39 (plain)
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
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#include "oddbool.h"

ComparisonTester::ComparisonTester(int v) : m_value(v)
{
}

ComparisonTester& ComparisonTester::operator=(int v)
{
    m_value = v;
    return *this;
}

int ComparisonTester::compare(const ComparisonTester &rhs) const
{
    if (m_value < rhs.m_value)
        return -1;
    if (m_value > rhs.m_value)
        return 1;
    return 0;
}

SpaceshipComparisonTester::SpaceshipComparisonTester(int v) : m_value(v)
{
}