aboutsummaryrefslogtreecommitdiff
path: root/src/tests/listsort.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/listsort.cpp')
-rw-r--r--src/tests/listsort.cpp79
1 files changed, 0 insertions, 79 deletions
diff --git a/src/tests/listsort.cpp b/src/tests/listsort.cpp
deleted file mode 100644
index 4873a05..0000000
--- a/src/tests/listsort.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
1/*
2 * Copyright (C) 2007-2011 Xagasoft, All rights reserved.
3 *
4 * This file is part of the libbu++ library and is released under the
5 * terms of the license contained in the file LICENSE.
6 */
7
8#include <bu/list.h>
9#include <bu/sio.h>
10#include <bu/string.h>
11
12using namespace Bu;
13
14int main()
15{
16 /*
17 List<int> il;
18 il.append( 5 );
19 il.append( 12 );
20 il.append( 0 );
21 il.append( 7 );
22 il.append( 3 );
23 il.append( 5 );
24 Bu::__basicLTCmp<int> cmp;
25 il.sortI( cmp );
26 */
27
28 String a("Soggy"), b("Sam");
29
30 if( a < b )
31 {
32 sio << "Bad" << sio.nl;
33 }
34 else
35 {
36 sio << "Good" << sio.nl;
37 }
38
39 typedef List<String> StrList;
40
41 StrList lNames;
42
43 lNames.append("George");
44 lNames.append("Sam");
45 lNames.append("Abby");
46 lNames.append("Zorro");
47 lNames.append("Brianna");
48 lNames.append("Kate");
49 lNames.append("Soggy");
50
51 sio << "Names: " << lNames << sio.nl;
52 lNames.sort();
53
54 sio << "Names: " << lNames << sio.nl;
55
56 StrList lNames2;
57
58 lNames2.insertSorted("George");
59 lNames2.insertSorted("Sam");
60 lNames2.insertSorted("Abby");
61 lNames2.insertSorted("Zorro");
62 lNames2.insertSorted("Brianna");
63 lNames2.insertSorted("Kate");
64 lNames2.insertSorted("Soggy");
65
66 sio << "Names: " << lNames2 << sio.nl;
67
68 if( lNames == lNames2 )
69 {
70 sio << "They're the same." << sio.nl;
71 }
72 else
73 {
74 sio << "They're different." << sio.nl;
75 }
76
77 return 0;
78}
79