3 * Copyright (C) 2009 Didier Villevalois, Julien Peeters
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 * Didier 'Ptitjes' Villevalois <ptitjes@free.fr>
21 * Julien Peeters <contact@julienpeeters.fr>
26 public class HashSetTests : SetTests {
28 public HashSetTests () {
30 add_test ("[HashSet] selected functions", test_selected_functions);
31 add_test ("[HashSet] GObject properties", test_gobject_properties);
34 public override void set_up () {
35 test_collection = new HashSet<string> ();
38 public override void tear_down () {
39 test_collection = null;
42 public void test_selected_functions () {
43 var test_set = test_collection as HashSet<string>;
45 // Check the map exists
46 assert (test_set != null);
48 // Check the selected hash and equal functions
49 assert (test_set.hash_func == str_hash);
50 assert (test_set.equal_func == str_equal);
53 public new void test_gobject_properties () {
54 var test_set = test_collection as HashSet<string>;
56 // Check the list exists
57 assert (test_set != null);
60 value = Value (typeof (HashFunc));
61 test_set.get_property ("hash-func", ref value);
62 assert (value.get_pointer () == (void*) test_set.hash_func);
65 value = Value (typeof (EqualFunc));
66 test_set.get_property ("equal-func", ref value);
67 assert (value.get_pointer () == (void*) test_set.equal_func);