]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/qt5/qtpurchasing.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / tools / build / test / qt5 / qtpurchasing.cpp
1 // (c) Copyright Juergen Hunold 2016
2 // Use, modification and distribution is subject to the Boost Software
3 // License, Version 1.0. (See accompanying file LICENSE.txt or copy at
4 // https://www.bfgroup.xyz/b2/LICENSE.txt)
5
6 #define BOOST_TEST_MODULE QtPurchasing
7
8 #include <QtPurchasing>
9
10 #include <boost/test/unit_test.hpp>
11
12 BOOST_AUTO_TEST_CASE (defines)
13 {
14 BOOST_CHECK_EQUAL(BOOST_IS_DEFINED(QT_CORE_LIB), true);
15 BOOST_CHECK_EQUAL(BOOST_IS_DEFINED(QT_PURCHASING_LIB), true);
16 }
17
18 class DummyProduct : public QInAppProduct
19 {
20 public:
21
22 DummyProduct() : QInAppProduct{QStringLiteral("One"),
23 QString{},
24 QString{},
25 Consumable,
26 QStringLiteral("DummyProduct"),
27 nullptr} {};
28 void purchase() override {};
29 };
30
31 std::ostream&
32 operator << (std::ostream& stream, QString const& string)
33 {
34 stream << qPrintable(string);
35 return stream;
36 }
37
38 BOOST_AUTO_TEST_CASE (purchase)
39 {
40 DummyProduct product;
41
42 BOOST_TEST(product.price() == QLatin1String("One"));
43 BOOST_TEST(product.identifier() == QLatin1String("DummyProduct"));
44 }