[vala] Fix test of previous commit a6df1b9
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] Fix test of previous commit a6df1b9
- Date: Mon, 22 Dec 2014 09:21:16 +0000 (UTC)
commit f8b8cae8cabc2ba7ceb9629cde5b530d997ef89c
Author: Luca Bruno <lucabru src gnome org>
Date: Mon Dec 22 10:18:00 2014 +0100
Fix test of previous commit a6df1b9
tests/basic-types/bug731017.vala | 29 +++++++++++++++--------------
1 files changed, 15 insertions(+), 14 deletions(-)
---
diff --git a/tests/basic-types/bug731017.vala b/tests/basic-types/bug731017.vala
index 0b1e0ac..4f25205 100644
--- a/tests/basic-types/bug731017.vala
+++ b/tests/basic-types/bug731017.vala
@@ -1,17 +1,18 @@
-[CCode (cname = "g_hash_table_get_keys_as_array", array_length_type = "guint", type = "gpointer*")]
-public extern (unowned string)[] g_hash_table_get_keys_as_array (GLib.HashTable<string,string> hash_table);
+string foo = null;
-private static int main (string[] args) {
- var ht = new GLib.HashTable<string,string> (GLib.str_hash, GLib.str_equal);
- ht["one"] = "hello";
- ht["two"] = "world";
+(unowned string)[] bar () {
+ (unowned string)[] ret = new (unowned string)[1];
+ ret[0] = foo;
+ return ret;
+}
- string[] keys = g_hash_table_get_keys_as_array (ht);
- ht = null;
-
- foreach (unowned string k in keys) {
- assert (k == "one" || k == "two");
- }
-
- return 0;
+void main() {
+ foo = "foo";
+
+ string[] keys = bar();
+ foo = null;
+
+ foreach (unowned string k in keys) {
+ assert (k == "foo");
+ }
}
\ No newline at end of file
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]