aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/libopenshot-fixup-tests.patch
blob: 9a0bcc5e8f966977c530006d2374f98167e298a3 (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
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
From 691536f2f8a9ed7322fedb24d489db08c70705b9 Mon Sep 17 00:00:00 2001
From: "Dr. Tobias Quathamer" <toddy@debian.org>
Date: Sat, 18 Nov 2017 13:54:22 +0100
Subject: [PATCH] This the combination of two patches:
 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
 https://sources.debian.org/data/main/libo/libopenshot/0.2.2+dfsg1-1/debian/patches/0004-Add-some-more-fault-tolerance-for-arm64.patch

Together they should fix the test suite on all architectures
---
 tests/FFmpegReader_Tests.cpp |  9 ++++-----
 tests/ImageWriter_Tests.cpp  |  8 ++++----
 tests/Timeline_Tests.cpp     | 28 ++++++++++++++--------------
 3 files changed, 22 insertions(+), 23 deletions(-)

diff --git a/tests/FFmpegReader_Tests.cpp b/tests/FFmpegReader_Tests.cpp
index 53563ca..07fc41e 100644
--- a/tests/FFmpegReader_Tests.cpp
+++ b/tests/FFmpegReader_Tests.cpp
@@ -95,8 +95,8 @@ TEST(FFmpegReader_Check_Video_File)
 	int pixel_index = 112 * 4; // pixel 112 (4 bytes per pixel)
 
 	// Check image properties on scanline 10, pixel 112
-	CHECK_EQUAL(21, (int)pixels[pixel_index]);
-	CHECK_EQUAL(191, (int)pixels[pixel_index + 1]);
+	CHECK_CLOSE(21, (int)pixels[pixel_index], 1);
+	CHECK_CLOSE(191, (int)pixels[pixel_index + 1], 2);
 	CHECK_EQUAL(0, (int)pixels[pixel_index + 2]);
 	CHECK_EQUAL(255, (int)pixels[pixel_index + 3]);
 
@@ -109,8 +109,8 @@ TEST(FFmpegReader_Check_Video_File)
 
 	// Check image properties on scanline 10, pixel 112
 	CHECK_EQUAL(0, (int)pixels[pixel_index]);
-	CHECK_EQUAL(96, (int)pixels[pixel_index + 1]);
-	CHECK_EQUAL(188, (int)pixels[pixel_index + 2]);
+	CHECK_CLOSE(96, (int)pixels[pixel_index + 1], 1);
+	CHECK_CLOSE(188, (int)pixels[pixel_index + 2], 1);
 	CHECK_EQUAL(255, (int)pixels[pixel_index + 3]);
 
 	// Close reader
@@ -209,4 +209,3 @@ TEST(FFmpegReader_Multiple_Open_and_Close)
 	// Close reader
 	r.Close();
 }
-
diff --git a/tests/ImageWriter_Tests.cpp b/tests/ImageWriter_Tests.cpp
index 107ee39..d10c8bd 100644
--- a/tests/ImageWriter_Tests.cpp
+++ b/tests/ImageWriter_Tests.cpp
@@ -73,9 +73,9 @@ TEST(ImageWriter_Test_Gif)
 	int pixel_index = 230 * 4; // pixel 230 (4 bytes per pixel)
 
 	// Check image properties
-	CHECK_EQUAL(20, (int)pixels[pixel_index]);
-	CHECK_EQUAL(18, (int)pixels[pixel_index + 1]);
-	CHECK_EQUAL(11, (int)pixels[pixel_index + 2]);
+	CHECK_CLOSE(20, (int)pixels[pixel_index], 5);
+	CHECK_CLOSE(18, (int)pixels[pixel_index + 1], 2);
+	CHECK_CLOSE(11, (int)pixels[pixel_index + 2], 2);
 	CHECK_EQUAL(255, (int)pixels[pixel_index + 3]);
 }
-#endif
\ No newline at end of file
+#endif
diff --git a/tests/Timeline_Tests.cpp b/tests/Timeline_Tests.cpp
index 8c81579..4d861a6 100644
--- a/tests/Timeline_Tests.cpp
+++ b/tests/Timeline_Tests.cpp
@@ -119,8 +119,8 @@ TEST(Timeline_Check_Two_Track_Video)
 	int pixel_index = 230 * 4; // pixel 230 (4 bytes per pixel)
 
 	// Check image properties
-	CHECK_EQUAL(21, (int)f->GetPixels(pixel_row)[pixel_index]);
-	CHECK_EQUAL(191, (int)f->GetPixels(pixel_row)[pixel_index + 1]);
+	CHECK_CLOSE(21, (int)f->GetPixels(pixel_row)[pixel_index], 2);
+	CHECK_CLOSE(191, (int)f->GetPixels(pixel_row)[pixel_index + 1], 2);
 	CHECK_EQUAL(0, (int)f->GetPixels(pixel_row)[pixel_index + 2]);
 	CHECK_EQUAL(255, (int)f->GetPixels(pixel_row)[pixel_index + 3]);
 
@@ -128,17 +128,17 @@ TEST(Timeline_Check_Two_Track_Video)
 	f = t.GetFrame(2);
 
 	// Check image properties
-	CHECK_EQUAL(176, (int)f->GetPixels(pixel_row)[pixel_index]);
+	CHECK_CLOSE(176, (int)f->GetPixels(pixel_row)[pixel_index], 1);
 	CHECK_EQUAL(0, (int)f->GetPixels(pixel_row)[pixel_index + 1]);
-	CHECK_EQUAL(186, (int)f->GetPixels(pixel_row)[pixel_index + 2]);
+	CHECK_CLOSE(186, (int)f->GetPixels(pixel_row)[pixel_index + 2], 1);
 	CHECK_EQUAL(255, (int)f->GetPixels(pixel_row)[pixel_index + 3]);
 
 	// Get frame
 	f = t.GetFrame(3);
 
 	// Check image properties
-	CHECK_EQUAL(23, (int)f->GetPixels(pixel_row)[pixel_index]);
-	CHECK_EQUAL(190, (int)f->GetPixels(pixel_row)[pixel_index + 1]);
+	CHECK_CLOSE(23, (int)f->GetPixels(pixel_row)[pixel_index], 1);
+	CHECK_CLOSE(190, (int)f->GetPixels(pixel_row)[pixel_index + 1], 2);
 	CHECK_EQUAL(0, (int)f->GetPixels(pixel_row)[pixel_index + 2]);
 	CHECK_EQUAL(255, (int)f->GetPixels(pixel_row)[pixel_index + 3]);
 
@@ -146,8 +146,8 @@ TEST(Timeline_Check_Two_Track_Video)
 	f = t.GetFrame(24);
 
 	// Check image properties
-	CHECK_EQUAL(186, (int)f->GetPixels(pixel_row)[pixel_index]);
-	CHECK_EQUAL(106, (int)f->GetPixels(pixel_row)[pixel_index + 1]);
+	CHECK_CLOSE(186, (int)f->GetPixels(pixel_row)[pixel_index], 1);
+	CHECK_CLOSE(106, (int)f->GetPixels(pixel_row)[pixel_index + 1], 1);
 	CHECK_EQUAL(0, (int)f->GetPixels(pixel_row)[pixel_index + 2]);
 	CHECK_EQUAL(255, (int)f->GetPixels(pixel_row)[pixel_index + 3]);
 
@@ -155,8 +155,8 @@ TEST(Timeline_Check_Two_Track_Video)
 	f = t.GetFrame(5);
 
 	// Check image properties
-	CHECK_EQUAL(23, (int)f->GetPixels(pixel_row)[pixel_index]);
-	CHECK_EQUAL(190, (int)f->GetPixels(pixel_row)[pixel_index + 1]);
+	CHECK_CLOSE(23, (int)f->GetPixels(pixel_row)[pixel_index], 1);
+	CHECK_CLOSE(190, (int)f->GetPixels(pixel_row)[pixel_index + 1], 2);
 	CHECK_EQUAL(0, (int)f->GetPixels(pixel_row)[pixel_index + 2]);
 	CHECK_EQUAL(255, (int)f->GetPixels(pixel_row)[pixel_index + 3]);
 
@@ -165,17 +165,17 @@ TEST(Timeline_Check_Two_Track_Video)
 
 	// Check image properties
 	CHECK_EQUAL(0, (int)f->GetPixels(pixel_row)[pixel_index]);
-	CHECK_EQUAL(94, (int)f->GetPixels(pixel_row)[pixel_index + 1]);
-	CHECK_EQUAL(186, (int)f->GetPixels(pixel_row)[pixel_index + 2]);
+	CHECK_CLOSE(94, (int)f->GetPixels(pixel_row)[pixel_index + 1], 1);
+	CHECK_CLOSE(186, (int)f->GetPixels(pixel_row)[pixel_index + 2], 1);
 	CHECK_EQUAL(255, (int)f->GetPixels(pixel_row)[pixel_index + 3]);
 
 	// Get frame
 	f = t.GetFrame(4);
 
 	// Check image properties
-	CHECK_EQUAL(176, (int)f->GetPixels(pixel_row)[pixel_index]);
+	CHECK_CLOSE(176, (int)f->GetPixels(pixel_row)[pixel_index], 1);
 	CHECK_EQUAL(0, (int)f->GetPixels(pixel_row)[pixel_index + 1]);
-	CHECK_EQUAL(186, (int)f->GetPixels(pixel_row)[pixel_index + 2]);
+	CHECK_CLOSE(186, (int)f->GetPixels(pixel_row)[pixel_index + 2], 1);
 	CHECK_EQUAL(255, (int)f->GetPixels(pixel_row)[pixel_index + 3]);
 
 	// Close reader
-- 
2.21.0