2017-03-15 20:38:55 +01:00
|
|
|
From: =?UTF-8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de>
|
|
|
|
Date: Thu, 24 Sep 2015 19:23:50 +0200
|
2019-01-04 22:08:16 +01:00
|
|
|
Subject: test-string-input-visitor: Add int test case
|
2017-03-15 20:38:55 +01:00
|
|
|
MIME-Version: 1.0
|
|
|
|
Content-Type: text/plain; charset=UTF-8
|
|
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
|
|
|
|
In addition to -42 also parse the maximum int64.
|
|
|
|
|
|
|
|
Signed-off-by: Andreas Färber <afaerber@suse.de>
|
|
|
|
---
|
|
|
|
tests/test-string-input-visitor.c | 8 ++++++++
|
|
|
|
1 file changed, 8 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/tests/test-string-input-visitor.c b/tests/test-string-input-visitor.c
|
2018-05-01 17:20:58 +02:00
|
|
|
index 88e0e1aa9a..9bbe9c1120 100644
|
2017-03-15 20:38:55 +01:00
|
|
|
--- a/tests/test-string-input-visitor.c
|
|
|
|
+++ b/tests/test-string-input-visitor.c
|
2018-05-01 17:20:58 +02:00
|
|
|
@@ -53,6 +53,14 @@ static void test_visitor_in_int(TestInputVisitorData *data,
|
2018-02-08 20:55:31 +01:00
|
|
|
|
|
|
|
v = visitor_input_test_init(data, "-42");
|
|
|
|
|
|
|
|
+ visit_type_int(v, NULL, &res, &err);
|
|
|
|
+ g_assert(!err);
|
|
|
|
+ g_assert_cmpint(res, ==, value);
|
2017-03-15 20:38:55 +01:00
|
|
|
+ visitor_input_teardown(data, unused);
|
|
|
|
+
|
|
|
|
+ value = INT64_MAX;
|
|
|
|
+ v = visitor_input_test_init(data, g_strdup_printf("%" PRId64, value));
|
|
|
|
+
|
2018-02-08 20:55:31 +01:00
|
|
|
visit_type_int(v, NULL, &res, &err);
|
|
|
|
g_assert(!err);
|
|
|
|
g_assert_cmpint(res, ==, value);
|