[gjs] tests: Fix format strings
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs] tests: Fix format strings
- Date: Sat, 22 Oct 2016 01:44:31 +0000 (UTC)
commit 7ad4a80af5fb876b581158f98f116aea352e4914
Author: Philip Chimento <philip chimento gmail com>
Date: Sun Oct 2 15:49:14 2016 -0700
tests: Fix format strings
sscanf() needs a pointer to a char array, not a pointer to a pointer to a
char array; and %lli is not the correct format specifier for gint64 on
all platforms, but since those struct fields are longs anyway we may as
well just print longs.
https://bugzilla.gnome.org/show_bug.cgi?id=773297
test/gjs-test-coverage.cpp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/test/gjs-test-coverage.cpp b/test/gjs-test-coverage.cpp
index c413c50..6b93874 100644
--- a/test/gjs-test-coverage.cpp
+++ b/test/gjs-test-coverage.cpp
@@ -576,7 +576,7 @@ branch_at_line_should_be_taken(const char *line,
/* Advance past "BRDA:" */
line += 5;
- nmatches = sscanf(line, "%i,%i,%i,%19s", &line_no, &block_no, &branch_id, &hit_count);
+ nmatches = sscanf(line, "%i,%i,%i,%19s", &line_no, &block_no, &branch_id, hit_count);
if (nmatches != 4) {
if (errno != 0)
g_error("sscanf: %s", strerror(errno));
@@ -1625,7 +1625,7 @@ test_coverage_cache_data_in_expected_format(gpointer fixture_data,
&mtime);
g_assert_true(successfully_got_mtime);
- char *mtime_string = g_strdup_printf("[%lli,%lli]", (gint64) mtime.tv_sec, (gint64) mtime.tv_usec);
+ char *mtime_string = g_strdup_printf("[%li,%li]", mtime.tv_sec, mtime.tv_usec);
GString *expected_cache_object_notation = format_expected_cache_object_notation(mtime_string,
"null",
fixture->base_fixture.temporary_js_script_filename,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]