summaryrefslogtreecommitdiff
path: root/test/gjs-test-coverage.cpp
diff options
context:
space:
mode:
authorPhilip Chimento <philip.chimento@gmail.com>2016-10-02 15:49:14 -0700
committerPhilip Chimento <philip@endlessm.com>2016-10-21 18:41:25 -0700
commit7ad4a80af5fb876b581158f98f116aea352e4914 (patch)
tree69bf0ae5b7d39e9fcac2d8574547388282cbc9bd /test/gjs-test-coverage.cpp
parentf96a98c7cb5be038300c11ec40f2f4ac0561dd6d (diff)
downloadgjs-7ad4a80af5fb876b581158f98f116aea352e4914.tar.gz
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
Diffstat (limited to 'test/gjs-test-coverage.cpp')
-rw-r--r--test/gjs-test-coverage.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/gjs-test-coverage.cpp b/test/gjs-test-coverage.cpp
index c413c506..6b93874c 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,