Mercurial > hg > CbC > CbC_gcc
comparison gcc/typed-splay-tree.c @ 132:d34655255c78
update gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 10:21:07 +0900 |
parents | 84e7813d76e9 |
children | 1830386684a0 |
comparison
equal
deleted
inserted
replaced
130:e108057fa461 | 132:d34655255c78 |
---|---|
1 /* Selftests for typed-splay-tree.h. | 1 /* Selftests for typed-splay-tree.h. |
2 Copyright (C) 2016-2017 Free Software Foundation, Inc. | 2 Copyright (C) 2016-2018 Free Software Foundation, Inc. |
3 | 3 |
4 This file is part of GCC. | 4 This file is part of GCC. |
5 | 5 |
6 GCC is free software; you can redistribute it and/or modify it under | 6 GCC is free software; you can redistribute it and/or modify it under |
7 the terms of the GNU General Public License as published by the Free | 7 the terms of the GNU General Public License as published by the Free |
45 typed_splay_tree <const char *, int> t (strcmp, NULL, NULL); | 45 typed_splay_tree <const char *, int> t (strcmp, NULL, NULL); |
46 | 46 |
47 t.insert ("a", 1); | 47 t.insert ("a", 1); |
48 t.insert ("b", 2); | 48 t.insert ("b", 2); |
49 t.insert ("c", 3); | 49 t.insert ("c", 3); |
50 t.insert ("d", 4); | |
51 | |
52 t.remove ("d"); | |
50 | 53 |
51 ASSERT_EQ (1, t.lookup ("a")); | 54 ASSERT_EQ (1, t.lookup ("a")); |
52 ASSERT_EQ (2, t.lookup ("b")); | 55 ASSERT_EQ (2, t.lookup ("b")); |
53 ASSERT_EQ (3, t.lookup ("c")); | 56 ASSERT_EQ (3, t.lookup ("c")); |
54 | 57 |