summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2022-10-20 14:44:45 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-11-09 17:42:08 +0000
commita6081883a344b6b7f9ced12408a790041b312e2c (patch)
treefeb53be2efbbccadcf8399c114113d653f8ed1a0
parenta8ed5babd52bb6c41f909a37b1a7d4cf76a7fba2 (diff)
downloadpoky-a6081883a344b6b7f9ced12408a790041b312e2c.tar.gz
glib-2.0: fix rare GFileInfo test case failure
If a access or creation timestamp has 0 microseconds, then the test fails as it doesn't expect this to be a valid value. Expand a previous fix for modification times to cover these timestamps too. [ YOCTO #14373 ] (From OE-Core rev: a4e29fe2bd3f834f8253716790fbbf032aad9fcc) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 15715e6ad81c97cd50e288f3745615eb19be90d1) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0/0001-gio-tests-g-file-info-don-t-assume-million-in-one-ev.patch51
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0_2.72.3.bb1
2 files changed, 52 insertions, 0 deletions
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/0001-gio-tests-g-file-info-don-t-assume-million-in-one-ev.patch b/meta/recipes-core/glib-2.0/glib-2.0/0001-gio-tests-g-file-info-don-t-assume-million-in-one-ev.patch
new file mode 100644
index 0000000000..c33fa88a76
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/0001-gio-tests-g-file-info-don-t-assume-million-in-one-ev.patch
@@ -0,0 +1,51 @@
1Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2990]
2Signed-off-by: Ross Burton <ross.burton@arm.com>
3
4From 14838522a706ebdcc3cdab661d4c368099fe3a4e Mon Sep 17 00:00:00 2001
5From: Ross Burton <ross.burton@arm.com>
6Date: Tue, 6 Jul 2021 19:26:03 +0100
7Subject: [PATCH] gio/tests/g-file-info: don't assume million-in-one events
8 don't happen
9
10The access and creation time tests create a file, gets the time in
11seconds, then gets the time in microseconds and assumes that the
12difference between the two has to be above 0.
13
14As rare as this may be, it can happen:
15
16$ stat g-file-info-test-50A450 -c %y
172021-07-06 18:24:56.000000767 +0100
18
19Change the test to simply assert that the difference not negative to
20handle this case.
21
22This is the same fix as 289f8b, but that was just modification time.
23---
24 gio/tests/g-file-info.c | 4 ++--
25 1 file changed, 2 insertions(+), 2 deletions(-)
26
27diff --git a/gio/tests/g-file-info.c b/gio/tests/g-file-info.c
28index 59411c3a8..a213e4b92 100644
29--- a/gio/tests/g-file-info.c
30+++ b/gio/tests/g-file-info.c
31@@ -239,7 +239,7 @@ test_g_file_info_access_time (void)
32 g_assert_nonnull (dt_usecs);
33
34 ts = g_date_time_difference (dt_usecs, dt);
35- g_assert_cmpint (ts, >, 0);
36+ g_assert_cmpint (ts, >=, 0);
37 g_assert_cmpint (ts, <, G_USEC_PER_SEC);
38
39 /* Try round-tripping the access time. */
40@@ -316,7 +316,7 @@ test_g_file_info_creation_time (void)
41 g_assert_nonnull (dt_usecs);
42
43 ts = g_date_time_difference (dt_usecs, dt);
44- g_assert_cmpint (ts, >, 0);
45+ g_assert_cmpint (ts, >=, 0);
46 g_assert_cmpint (ts, <, G_USEC_PER_SEC);
47
48 /* Try round-tripping the creation time. */
49--
502.34.1
51
diff --git a/meta/recipes-core/glib-2.0/glib-2.0_2.72.3.bb b/meta/recipes-core/glib-2.0/glib-2.0_2.72.3.bb
index dd1ea508d2..b5ab6502a3 100644
--- a/meta/recipes-core/glib-2.0/glib-2.0_2.72.3.bb
+++ b/meta/recipes-core/glib-2.0/glib-2.0_2.72.3.bb
@@ -16,6 +16,7 @@ SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \
16 file://0001-Do-not-write-bindir-into-pkg-config-files.patch \ 16 file://0001-Do-not-write-bindir-into-pkg-config-files.patch \
17 file://0001-meson-Run-atomics-test-on-clang-as-well.patch \ 17 file://0001-meson-Run-atomics-test-on-clang-as-well.patch \
18 file://0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch \ 18 file://0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch \
19 file://0001-gio-tests-g-file-info-don-t-assume-million-in-one-ev.patch \
19 " 20 "
20SRC_URI:append:class-native = " file://relocate-modules.patch" 21SRC_URI:append:class-native = " file://relocate-modules.patch"
21 22