File: formattest.h

package info (click to toggle)
kdepim-runtime 4%3A24.12.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 24,012 kB
  • sloc: cpp: 90,562; xml: 1,020; javascript: 60; sh: 58; makefile: 13
file content (58 lines) | stat: -rw-r--r-- 1,929 bytes parent folder | download | duplicates (2)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
 * SPDX-FileCopyrightText: 2012 Christian Mollekopf <mollekopf@kolabsys.com>
 *
 * SPDX-License-Identifier: LGPL-3.0-or-later
 */

#pragma once
#include <QObject>

/**
 * Test complete serialization from mime message to KCalendarCore/KContacts containers.
 *
 * The .ics .vcf files serve as reference, under the assumption that the iCal/vCard implementations don't have bugs.
 *
 * The .ics.mime/.vcf.mime messages are first used to test parsing, and then to compare the result after serialization.
 * The mime files are of course just a snapshot of how it is thought that the result should be.
 * The files may have bugs themselves and will need to be updated to reflect future changes.
 *
 * kompare (the kde diff tool) is launched if a test fails to show you the difference between expected and actual conversion.
 * Comment the code if you don't want it.
 *
 * Note that some parts of the mime message are not compared, but show up in kompare as difference:
 * * Date-Header
 * * Content-Type-Header
 * * next-part markers
 * * Content-ID Header
 *
 * These are safe to be ignored as they are randomly generated.
 *
 * To generate the reference files, you can write the vcf/ics by hand and generate the mime message from that one (using the generateMimefile() function).
 * You may need to sort some things manually (addresses/phonenumbers), and generally check manually if everything is as it should be.
 * The test will then remain to ensure the same for future versions.
 *
 */
class FormatTest : public QObject
{
    Q_OBJECT
private Q_SLOTS:

    void initTestCase();

    void testIncidence_data();
    void testIncidence();

    void testContact_data();
    void testContact();

    void testDistlist_data();
    void testDistlist();

    void testNote_data();
    void testNote();

    // Some pseudo tests and helper functions
    void generateMimefile();
    void generateVCard();
    void proveJPGisLossy();
};