Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:GA
qemu.2059
0200-test-string-input-visitor-Add-uint6.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0200-test-string-input-visitor-Add-uint6.patch of Package qemu.2059
From bbaea9bffef8b2df8f56f10e2b8cc4a01e497170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de> Date: Thu, 24 Sep 2015 19:24:23 +0200 Subject: [PATCH] test-string-input-visitor: Add uint64 test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Test parsing of decimal and hexadecimal uint64 numbers with most significant bit set. Signed-off-by: Andreas Färber <afaerber@suse.de> --- tests/test-string-input-visitor.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/test-string-input-visitor.c b/tests/test-string-input-visitor.c index d406263..62cdec6 100644 --- a/tests/test-string-input-visitor.c +++ b/tests/test-string-input-visitor.c @@ -64,6 +64,27 @@ static void test_visitor_in_int(TestInputVisitorData *data, g_assert_cmpint(res, ==, value); } +static void test_visitor_in_uint64(TestInputVisitorData *data, + const void *unused) +{ + uint64_t res = 0, value = UINT64_MAX; + Error *err = NULL; + Visitor *v; + + v = visitor_input_test_init(data, g_strdup_printf("%" PRIu64, value)); + + visit_type_uint64(v, &res, NULL, &err); + g_assert(!err); + g_assert_cmpint(res, ==, value); + visitor_input_teardown(data, unused); + + v = visitor_input_test_init(data, g_strdup_printf("0x%" PRIx64, value)); + + visit_type_uint64(v, &res, NULL, &err); + g_assert(!err); + g_assert_cmpint(res, ==, value); +} + static void test_visitor_in_bool(TestInputVisitorData *data, const void *unused) { @@ -228,6 +249,8 @@ int main(int argc, char **argv) input_visitor_test_add("/string-visitor/input/int", &in_visitor_data, test_visitor_in_int); + input_visitor_test_add("/string-visitor/input/uint64", + &in_visitor_data, test_visitor_in_uint64); input_visitor_test_add("/string-visitor/input/bool", &in_visitor_data, test_visitor_in_bool); input_visitor_test_add("/string-visitor/input/number",
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor