diff options
| -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.patch | 51 | ||||
| -rw-r--r-- | meta/recipes-core/glib-2.0/glib-2.0_2.72.3.bb | 1 |
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 @@ | |||
| 1 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2990] | ||
| 2 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
| 3 | |||
| 4 | From 14838522a706ebdcc3cdab661d4c368099fe3a4e Mon Sep 17 00:00:00 2001 | ||
| 5 | From: Ross Burton <ross.burton@arm.com> | ||
| 6 | Date: Tue, 6 Jul 2021 19:26:03 +0100 | ||
| 7 | Subject: [PATCH] gio/tests/g-file-info: don't assume million-in-one events | ||
| 8 | don't happen | ||
| 9 | |||
| 10 | The access and creation time tests create a file, gets the time in | ||
| 11 | seconds, then gets the time in microseconds and assumes that the | ||
| 12 | difference between the two has to be above 0. | ||
| 13 | |||
| 14 | As rare as this may be, it can happen: | ||
| 15 | |||
| 16 | $ stat g-file-info-test-50A450 -c %y | ||
| 17 | 2021-07-06 18:24:56.000000767 +0100 | ||
| 18 | |||
| 19 | Change the test to simply assert that the difference not negative to | ||
| 20 | handle this case. | ||
| 21 | |||
| 22 | This 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 | |||
| 27 | diff --git a/gio/tests/g-file-info.c b/gio/tests/g-file-info.c | ||
| 28 | index 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 | -- | ||
| 50 | 2.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 | " |
| 20 | SRC_URI:append:class-native = " file://relocate-modules.patch" | 21 | SRC_URI:append:class-native = " file://relocate-modules.patch" |
| 21 | 22 | ||
