gnu: libopenshot-audio: Update to 0.1.8.
[jackhill/guix/guix.git] / gnu / packages / patches / libopenshot-fixup-tests.patch
CommitLineData
4f889375
EF
1From 691536f2f8a9ed7322fedb24d489db08c70705b9 Mon Sep 17 00:00:00 2001
2From: "Dr. Tobias Quathamer" <toddy@debian.org>
3Date: Sat, 18 Nov 2017 13:54:22 +0100
4Subject: [PATCH] This the combination of two patches:
5 https://sources.debian.org/data/main/libo/libopenshot/0.2.2+dfsg1-1/debian/patches/0003-Fix-failing-tests-by-using-a-fault-tolerance.patch
6 https://sources.debian.org/data/main/libo/libopenshot/0.2.2+dfsg1-1/debian/patches/0004-Add-some-more-fault-tolerance-for-arm64.patch
7
8Together they should fix the test suite on all architectures
9---
10 tests/FFmpegReader_Tests.cpp | 9 ++++-----
11 tests/ImageWriter_Tests.cpp | 8 ++++----
12 tests/Timeline_Tests.cpp | 28 ++++++++++++++--------------
13 3 files changed, 22 insertions(+), 23 deletions(-)
14
15diff --git a/tests/FFmpegReader_Tests.cpp b/tests/FFmpegReader_Tests.cpp
16index 53563ca..07fc41e 100644
17--- a/tests/FFmpegReader_Tests.cpp
18+++ b/tests/FFmpegReader_Tests.cpp
19@@ -95,8 +95,8 @@ TEST(FFmpegReader_Check_Video_File)
20 int pixel_index = 112 * 4; // pixel 112 (4 bytes per pixel)
21
22 // Check image properties on scanline 10, pixel 112
23- CHECK_EQUAL(21, (int)pixels[pixel_index]);
24- CHECK_EQUAL(191, (int)pixels[pixel_index + 1]);
25+ CHECK_CLOSE(21, (int)pixels[pixel_index], 1);
26+ CHECK_CLOSE(191, (int)pixels[pixel_index + 1], 2);
27 CHECK_EQUAL(0, (int)pixels[pixel_index + 2]);
28 CHECK_EQUAL(255, (int)pixels[pixel_index + 3]);
29
30@@ -109,8 +109,8 @@ TEST(FFmpegReader_Check_Video_File)
31
32 // Check image properties on scanline 10, pixel 112
33 CHECK_EQUAL(0, (int)pixels[pixel_index]);
34- CHECK_EQUAL(96, (int)pixels[pixel_index + 1]);
35- CHECK_EQUAL(188, (int)pixels[pixel_index + 2]);
36+ CHECK_CLOSE(96, (int)pixels[pixel_index + 1], 1);
37+ CHECK_CLOSE(188, (int)pixels[pixel_index + 2], 1);
38 CHECK_EQUAL(255, (int)pixels[pixel_index + 3]);
39
40 // Close reader
41@@ -209,4 +209,3 @@ TEST(FFmpegReader_Multiple_Open_and_Close)
42 // Close reader
43 r.Close();
44 }
45-
46diff --git a/tests/ImageWriter_Tests.cpp b/tests/ImageWriter_Tests.cpp
47index 107ee39..d10c8bd 100644
48--- a/tests/ImageWriter_Tests.cpp
49+++ b/tests/ImageWriter_Tests.cpp
50@@ -73,9 +73,9 @@ TEST(ImageWriter_Test_Gif)
51 int pixel_index = 230 * 4; // pixel 230 (4 bytes per pixel)
52
53 // Check image properties
54- CHECK_EQUAL(20, (int)pixels[pixel_index]);
55- CHECK_EQUAL(18, (int)pixels[pixel_index + 1]);
56- CHECK_EQUAL(11, (int)pixels[pixel_index + 2]);
57+ CHECK_CLOSE(20, (int)pixels[pixel_index], 5);
58+ CHECK_CLOSE(18, (int)pixels[pixel_index + 1], 2);
59+ CHECK_CLOSE(11, (int)pixels[pixel_index + 2], 2);
60 CHECK_EQUAL(255, (int)pixels[pixel_index + 3]);
61 }
62-#endif
63\ No newline at end of file
64+#endif
65diff --git a/tests/Timeline_Tests.cpp b/tests/Timeline_Tests.cpp
66index 8c81579..4d861a6 100644
67--- a/tests/Timeline_Tests.cpp
68+++ b/tests/Timeline_Tests.cpp
69@@ -119,8 +119,8 @@ TEST(Timeline_Check_Two_Track_Video)
70 int pixel_index = 230 * 4; // pixel 230 (4 bytes per pixel)
71
72 // Check image properties
73- CHECK_EQUAL(21, (int)f->GetPixels(pixel_row)[pixel_index]);
74- CHECK_EQUAL(191, (int)f->GetPixels(pixel_row)[pixel_index + 1]);
75+ CHECK_CLOSE(21, (int)f->GetPixels(pixel_row)[pixel_index], 2);
76+ CHECK_CLOSE(191, (int)f->GetPixels(pixel_row)[pixel_index + 1], 2);
77 CHECK_EQUAL(0, (int)f->GetPixels(pixel_row)[pixel_index + 2]);
78 CHECK_EQUAL(255, (int)f->GetPixels(pixel_row)[pixel_index + 3]);
79
80@@ -128,17 +128,17 @@ TEST(Timeline_Check_Two_Track_Video)
81 f = t.GetFrame(2);
82
83 // Check image properties
84- CHECK_EQUAL(176, (int)f->GetPixels(pixel_row)[pixel_index]);
85+ CHECK_CLOSE(176, (int)f->GetPixels(pixel_row)[pixel_index], 1);
86 CHECK_EQUAL(0, (int)f->GetPixels(pixel_row)[pixel_index + 1]);
87- CHECK_EQUAL(186, (int)f->GetPixels(pixel_row)[pixel_index + 2]);
88+ CHECK_CLOSE(186, (int)f->GetPixels(pixel_row)[pixel_index + 2], 1);
89 CHECK_EQUAL(255, (int)f->GetPixels(pixel_row)[pixel_index + 3]);
90
91 // Get frame
92 f = t.GetFrame(3);
93
94 // Check image properties
95- CHECK_EQUAL(23, (int)f->GetPixels(pixel_row)[pixel_index]);
96- CHECK_EQUAL(190, (int)f->GetPixels(pixel_row)[pixel_index + 1]);
97+ CHECK_CLOSE(23, (int)f->GetPixels(pixel_row)[pixel_index], 1);
98+ CHECK_CLOSE(190, (int)f->GetPixels(pixel_row)[pixel_index + 1], 2);
99 CHECK_EQUAL(0, (int)f->GetPixels(pixel_row)[pixel_index + 2]);
100 CHECK_EQUAL(255, (int)f->GetPixels(pixel_row)[pixel_index + 3]);
101
102@@ -146,8 +146,8 @@ TEST(Timeline_Check_Two_Track_Video)
103 f = t.GetFrame(24);
104
105 // Check image properties
106- CHECK_EQUAL(186, (int)f->GetPixels(pixel_row)[pixel_index]);
107- CHECK_EQUAL(106, (int)f->GetPixels(pixel_row)[pixel_index + 1]);
108+ CHECK_CLOSE(186, (int)f->GetPixels(pixel_row)[pixel_index], 1);
109+ CHECK_CLOSE(106, (int)f->GetPixels(pixel_row)[pixel_index + 1], 1);
110 CHECK_EQUAL(0, (int)f->GetPixels(pixel_row)[pixel_index + 2]);
111 CHECK_EQUAL(255, (int)f->GetPixels(pixel_row)[pixel_index + 3]);
112
113@@ -155,8 +155,8 @@ TEST(Timeline_Check_Two_Track_Video)
114 f = t.GetFrame(5);
115
116 // Check image properties
117- CHECK_EQUAL(23, (int)f->GetPixels(pixel_row)[pixel_index]);
118- CHECK_EQUAL(190, (int)f->GetPixels(pixel_row)[pixel_index + 1]);
119+ CHECK_CLOSE(23, (int)f->GetPixels(pixel_row)[pixel_index], 1);
120+ CHECK_CLOSE(190, (int)f->GetPixels(pixel_row)[pixel_index + 1], 2);
121 CHECK_EQUAL(0, (int)f->GetPixels(pixel_row)[pixel_index + 2]);
122 CHECK_EQUAL(255, (int)f->GetPixels(pixel_row)[pixel_index + 3]);
123
124@@ -165,17 +165,17 @@ TEST(Timeline_Check_Two_Track_Video)
125
126 // Check image properties
127 CHECK_EQUAL(0, (int)f->GetPixels(pixel_row)[pixel_index]);
128- CHECK_EQUAL(94, (int)f->GetPixels(pixel_row)[pixel_index + 1]);
129- CHECK_EQUAL(186, (int)f->GetPixels(pixel_row)[pixel_index + 2]);
130+ CHECK_CLOSE(94, (int)f->GetPixels(pixel_row)[pixel_index + 1], 1);
131+ CHECK_CLOSE(186, (int)f->GetPixels(pixel_row)[pixel_index + 2], 1);
132 CHECK_EQUAL(255, (int)f->GetPixels(pixel_row)[pixel_index + 3]);
133
134 // Get frame
135 f = t.GetFrame(4);
136
137 // Check image properties
138- CHECK_EQUAL(176, (int)f->GetPixels(pixel_row)[pixel_index]);
139+ CHECK_CLOSE(176, (int)f->GetPixels(pixel_row)[pixel_index], 1);
140 CHECK_EQUAL(0, (int)f->GetPixels(pixel_row)[pixel_index + 1]);
141- CHECK_EQUAL(186, (int)f->GetPixels(pixel_row)[pixel_index + 2]);
142+ CHECK_CLOSE(186, (int)f->GetPixels(pixel_row)[pixel_index + 2], 1);
143 CHECK_EQUAL(255, (int)f->GetPixels(pixel_row)[pixel_index + 3]);
144
145 // Close reader
146--
1472.21.0
148