From: Rico Tzschichholz Date: Mon, 7 Nov 2016 19:49:14 +0000 (+0100) Subject: tests: More cases of FormatArg functions X-Git-Tag: 0.35.1~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2abdf6c72e083c78e5a2008e381ec76f27aad97;p=thirdparty%2Fvala.git tests: More cases of FormatArg functions --- diff --git a/tests/methods/bug774060.vala b/tests/methods/bug774060.vala index 84ab9c665..fe025e50c 100644 --- a/tests/methods/bug774060.vala +++ b/tests/methods/bug774060.vala @@ -1,7 +1,33 @@ +class Foo : Object { + public unowned string format (string bar, int baz, [FormatArg] string format) { + return format; + } + + [CCode (instance_pos = -1)] + public unowned string format_pos (string bar, int baz, [FormatArg] string format) { + return format; + } + + [NoWrapper] + public virtual unowned string format_virtual (string bar, int baz, [FormatArg] string format) { + return format; + } + + public static unowned string format_static (string foo, int baz, [FormatArg] string format) { + return format; + } +} + unowned string format_wrapper ([FormatArg] string format) { return format; } void main () { print (format_wrapper ("%d"), 42); + + var foo = new Foo (); + print (foo.format ("", 0, "%d"), 42); + print (foo.format_pos ("", 0, "%d"), 42); + print (foo.format_virtual ("", 0, "%d"), 42); + print (Foo.format_static ("", 0, "%d"), 42); }