1 /* Copyright (C) 2013-2020 Roland Lutz
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2 of the License, or
6 (at your option) any later version.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software Foundation,
15 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
23 xorn_revision_t rev0
, rev1
, rev2
, rev3
;
24 xorn_object_t ob0
, ob1a
, ob1b
;
26 xorn_object_t
*objects
;
29 setup(&rev0
, &rev1
, &rev2
, &rev3
, &ob0
, &ob1a
, &ob1b
);
31 assert(xorn_get_added_objects(rev0
, rev1
, &objects
, &count
) == 0);
32 assert(objects
!= NULL
);
34 assert(objects
[0] == ob0
);
36 assert(xorn_get_removed_objects(rev0
, rev1
, &objects
, &count
) == 0);
39 assert(xorn_get_modified_objects(rev0
, rev1
, &objects
, &count
) == 0);
43 assert(xorn_get_added_objects(rev1
, rev2
, &objects
, &count
) == 0);
44 assert(objects
!= NULL
);
46 assert((objects
[0] == ob1a
&& objects
[1] == ob1b
) ||
47 (objects
[0] == ob1b
&& objects
[1] == ob1a
));
49 assert(xorn_get_removed_objects(rev1
, rev2
, &objects
, &count
) == 0);
52 assert(xorn_get_modified_objects(rev1
, rev2
, &objects
, &count
) == 0);
56 assert(xorn_get_added_objects(rev2
, rev3
, &objects
, &count
) == 0);
59 assert(xorn_get_removed_objects(rev2
, rev3
, &objects
, &count
) == 0);
60 assert(objects
!= NULL
);
62 assert(objects
[0] == ob1a
);
64 assert(xorn_get_modified_objects(rev2
, rev3
, &objects
, &count
) == 0);
65 assert(objects
!= NULL
);
67 assert(objects
[0] == ob0
);
70 xorn_free_revision(rev3
);
71 xorn_free_revision(rev2
);
72 xorn_free_revision(rev1
);
73 xorn_free_revision(rev0
);