diff options
Diffstat (limited to '')
-rw-r--r-- | src/old/tests/clistress.cpp (renamed from src/tests/clistress.cpp) | 0 | ||||
-rw-r--r-- | src/old/tests/confpair.cpp (renamed from src/tests/confpair.cpp) | 0 | ||||
-rw-r--r-- | src/old/tests/connect.cpp (renamed from src/tests/connect.cpp) | 0 | ||||
-rw-r--r-- | src/old/tests/exception.cpp (renamed from src/tests/exception.cpp) | 0 | ||||
-rw-r--r-- | src/old/tests/formula.cpp (renamed from src/tests/formula.cpp) | 0 | ||||
-rw-r--r-- | src/old/tests/hash.cpp | 116 | ||||
-rw-r--r-- | src/old/tests/hashtest.cpp (renamed from src/tests/hashtest.cpp) | 0 | ||||
-rw-r--r-- | src/old/tests/hashtest2.cpp (renamed from src/tests/hashtest2.cpp) | 0 | ||||
-rw-r--r-- | src/old/tests/httpsrv/httpconnectionmonitor.cpp (renamed from src/tests/httpsrv/httpconnectionmonitor.cpp) | 0 | ||||
-rw-r--r-- | src/old/tests/httpsrv/httpconnectionmonitor.h (renamed from src/tests/httpsrv/httpconnectionmonitor.h) | 0 | ||||
-rw-r--r-- | src/old/tests/httpsrv/main.cpp (renamed from src/tests/httpsrv/main.cpp) | 0 | ||||
-rw-r--r-- | src/old/tests/log.cpp (renamed from src/tests/log.cpp) | 0 | ||||
-rw-r--r-- | src/old/tests/md5test.cpp (renamed from src/tests/md5test.cpp) | 0 | ||||
-rw-r--r-- | src/old/tests/ordhash.cpp (renamed from src/tests/ordhash.cpp) | 0 | ||||
-rw-r--r-- | src/old/tests/param.cpp (renamed from src/tests/param.cpp) | 0 | ||||
-rw-r--r-- | src/old/tests/param.h (renamed from src/tests/param.h) | 0 | ||||
-rw-r--r-- | src/old/tests/plugin/main.cpp (renamed from src/tests/plugin/main.cpp) | 0 | ||||
-rw-r--r-- | src/old/tests/plugin/plugin.cpp (renamed from src/tests/plugin/plugin.cpp) | 0 | ||||
-rw-r--r-- | src/old/tests/plugin/plugin.h (renamed from src/tests/plugin/plugin.h) | 0 | ||||
-rw-r--r-- | src/old/tests/qsort.cpp (renamed from src/tests/qsort.cpp) | 0 | ||||
-rw-r--r-- | src/old/tests/sbuffer.cpp (renamed from src/tests/sbuffer.cpp) | 0 | ||||
-rw-r--r-- | src/old/tests/serialize.cpp (renamed from src/tests/serialize.cpp) | 0 | ||||
-rw-r--r-- | src/old/tests/serializetext.cpp (renamed from src/tests/serializetext.cpp) | 0 | ||||
-rw-r--r-- | src/old/tests/sha1.cpp (renamed from src/tests/sha1.cpp) | 0 | ||||
-rw-r--r-- | src/old/tests/sptr.cpp (renamed from src/tests/sptr.cpp) | 30 | ||||
-rw-r--r-- | src/old/tests/srvstress.cpp (renamed from src/tests/srvstress.cpp) | 0 | ||||
-rw-r--r-- | src/old/tests/strhash.cpp (renamed from src/tests/strhash.cpp) | 0 | ||||
-rw-r--r-- | src/old/tests/teltest/main.cpp (renamed from src/tests/teltest/main.cpp) | 0 | ||||
-rw-r--r-- | src/old/tests/teltest/telnetmonitor.cpp (renamed from src/tests/teltest/telnetmonitor.cpp) | 0 | ||||
-rw-r--r-- | src/old/tests/teltest/telnetmonitor.h (renamed from src/tests/teltest/telnetmonitor.h) | 0 | ||||
-rw-r--r-- | src/old/tests/xmlreadtest.cpp (renamed from src/tests/xmlreadtest.cpp) | 0 | ||||
-rw-r--r-- | src/old/tests/xmlrepltest.cpp (renamed from src/tests/xmlrepltest.cpp) | 0 | ||||
-rw-r--r-- | src/old/tests/xmlwritetest.cpp (renamed from src/tests/xmlwritetest.cpp) | 0 |
33 files changed, 119 insertions, 27 deletions
diff --git a/src/tests/clistress.cpp b/src/old/tests/clistress.cpp index 6b0ac66..6b0ac66 100644 --- a/src/tests/clistress.cpp +++ b/src/old/tests/clistress.cpp | |||
diff --git a/src/tests/confpair.cpp b/src/old/tests/confpair.cpp index fb1b0d3..fb1b0d3 100644 --- a/src/tests/confpair.cpp +++ b/src/old/tests/confpair.cpp | |||
diff --git a/src/tests/connect.cpp b/src/old/tests/connect.cpp index a9fca64..a9fca64 100644 --- a/src/tests/connect.cpp +++ b/src/old/tests/connect.cpp | |||
diff --git a/src/tests/exception.cpp b/src/old/tests/exception.cpp index 6417692..6417692 100644 --- a/src/tests/exception.cpp +++ b/src/old/tests/exception.cpp | |||
diff --git a/src/tests/formula.cpp b/src/old/tests/formula.cpp index 976b039..976b039 100644 --- a/src/tests/formula.cpp +++ b/src/old/tests/formula.cpp | |||
diff --git a/src/old/tests/hash.cpp b/src/old/tests/hash.cpp new file mode 100644 index 0000000..2fc6968 --- /dev/null +++ b/src/old/tests/hash.cpp | |||
@@ -0,0 +1,116 @@ | |||
1 | #include "hash.h" | ||
2 | #include "staticstring.h" | ||
3 | |||
4 | int main() | ||
5 | { | ||
6 | const char *names[]={ | ||
7 | "Homer the Great", | ||
8 | "And Maggie Makes Three", | ||
9 | "Bart's Comet", | ||
10 | "Homie The Clown", | ||
11 | "Bart Vs Australia", | ||
12 | "Homer vs Patty and Selma", | ||
13 | "A star is burns", | ||
14 | "Lisa's Wedding", | ||
15 | "Two Dozen and One Greyhounds", | ||
16 | "The PTA Disbands", | ||
17 | "Round Springfield", | ||
18 | "The Springfield connection", | ||
19 | "Lemon of Troy", | ||
20 | "Who Shot Mr. Burns (Pt. 1)", | ||
21 | "Who Shot Mr. Burns (pt. 2)", | ||
22 | "Radioactive Man", | ||
23 | "Home Sweet Homediddly-dum-doodly", | ||
24 | "Bart Sells His Soul", | ||
25 | "Lisa the Vegetarian", | ||
26 | "Treehouse of horror VI", | ||
27 | "King Size Homer", | ||
28 | "Mother Simpson", | ||
29 | "Sideshow Bob's Last Gleaming", | ||
30 | "The Simpson's 138th Show Spectacular", | ||
31 | "Marge Be Not Proud", | ||
32 | "Team Homer", | ||
33 | "Two Bad Neighbors", | ||
34 | "Scenes From the Class Struggle in Springfield", | ||
35 | "Bart the Fink", | ||
36 | "Lisa the Iconoclast", | ||
37 | "Homer the Smithers", | ||
38 | "The Day the Violence Died", | ||
39 | "A Fish Called Selma", | ||
40 | "Bart on the road", | ||
41 | "22 Short Films about Springfield", | ||
42 | "The Curse of the Flying Hellfish", | ||
43 | "Much Apu about Nothing", | ||
44 | "Homerpalooza", | ||
45 | "The Summer of 4 Ft 2", | ||
46 | "Treehouse of Horror VII", | ||
47 | "You Only Move Twice", | ||
48 | "The Homer They Fall", | ||
49 | "Burns Baby Burns", | ||
50 | "Bart After Dark", | ||
51 | "A Millhouse Divided", | ||
52 | "Lisas Date With Destiny", | ||
53 | "Hurricane Neddy", | ||
54 | "The Mysterious Voyage of Our Homer", | ||
55 | "The Springfield Files", | ||
56 | "The Twisted World of Marge Simpson", | ||
57 | "Mountain of Madness", | ||
58 | NULL | ||
59 | }; | ||
60 | |||
61 | Hash<const char *, int> sTest; | ||
62 | |||
63 | printf("Inserting\n-------------------\n\n"); | ||
64 | for( int j = 0; j < 33; j++ ) | ||
65 | { | ||
66 | sTest[names[j]] = j; | ||
67 | } | ||
68 | |||
69 | printf("Test1: %d, Test2: %d\n", sTest.has("Lemon of Troy"), sTest.has(std::string("Lemon of Troy").c_str() ) ); | ||
70 | |||
71 | sTest.has(std::string("Lemon of Troy").c_str() ); | ||
72 | |||
73 | printf("Getting\n-------------------\n\n"); | ||
74 | |||
75 | sTest.erase("Homer the Great"); | ||
76 | sTest["Bart's Comet"].erase(); | ||
77 | |||
78 | for( Hash<const char *, int>::iterator i = sTest.begin(); | ||
79 | i != sTest.end(); i++ ) | ||
80 | { | ||
81 | Hash<const char *, int>::iterator j = i; | ||
82 | printf("%d: %s\n", (*j).second, (*j).first ); | ||
83 | } | ||
84 | |||
85 | printf("Testing\n-------------------\n\n"); | ||
86 | for( int j = 0; j < 33; j++ ) | ||
87 | { | ||
88 | if( sTest.has(names[j]) ) | ||
89 | { | ||
90 | if( sTest[names[j]] != j ) | ||
91 | { | ||
92 | printf("'%s' should be %d, is %d\n", | ||
93 | names[j], j, | ||
94 | sTest[names[j]].value() | ||
95 | ); | ||
96 | } | ||
97 | } | ||
98 | else | ||
99 | { | ||
100 | printf("Missing element %d, '%s'\n", j, names[j] ); | ||
101 | } | ||
102 | } | ||
103 | |||
104 | printf("Clearing\n-------------------\n\n"); | ||
105 | |||
106 | sTest.clear(); | ||
107 | |||
108 | for( Hash<const char *, int>::iterator i = sTest.begin(); | ||
109 | i != sTest.end(); i++ ) | ||
110 | { | ||
111 | Hash<const char *, int>::iterator j = i; | ||
112 | printf("%d: %s\n", (*j).second, (*j).first ); | ||
113 | } | ||
114 | |||
115 | } | ||
116 | |||
diff --git a/src/tests/hashtest.cpp b/src/old/tests/hashtest.cpp index eaa84a0..eaa84a0 100644 --- a/src/tests/hashtest.cpp +++ b/src/old/tests/hashtest.cpp | |||
diff --git a/src/tests/hashtest2.cpp b/src/old/tests/hashtest2.cpp index 74700fd..74700fd 100644 --- a/src/tests/hashtest2.cpp +++ b/src/old/tests/hashtest2.cpp | |||
diff --git a/src/tests/httpsrv/httpconnectionmonitor.cpp b/src/old/tests/httpsrv/httpconnectionmonitor.cpp index 51d82f3..51d82f3 100644 --- a/src/tests/httpsrv/httpconnectionmonitor.cpp +++ b/src/old/tests/httpsrv/httpconnectionmonitor.cpp | |||
diff --git a/src/tests/httpsrv/httpconnectionmonitor.h b/src/old/tests/httpsrv/httpconnectionmonitor.h index 30c0afd..30c0afd 100644 --- a/src/tests/httpsrv/httpconnectionmonitor.h +++ b/src/old/tests/httpsrv/httpconnectionmonitor.h | |||
diff --git a/src/tests/httpsrv/main.cpp b/src/old/tests/httpsrv/main.cpp index 2f1563c..2f1563c 100644 --- a/src/tests/httpsrv/main.cpp +++ b/src/old/tests/httpsrv/main.cpp | |||
diff --git a/src/tests/log.cpp b/src/old/tests/log.cpp index d7cfa0b..d7cfa0b 100644 --- a/src/tests/log.cpp +++ b/src/old/tests/log.cpp | |||
diff --git a/src/tests/md5test.cpp b/src/old/tests/md5test.cpp index 6f832df..6f832df 100644 --- a/src/tests/md5test.cpp +++ b/src/old/tests/md5test.cpp | |||
diff --git a/src/tests/ordhash.cpp b/src/old/tests/ordhash.cpp index f1d96ec..f1d96ec 100644 --- a/src/tests/ordhash.cpp +++ b/src/old/tests/ordhash.cpp | |||
diff --git a/src/tests/param.cpp b/src/old/tests/param.cpp index a4d2824..a4d2824 100644 --- a/src/tests/param.cpp +++ b/src/old/tests/param.cpp | |||
diff --git a/src/tests/param.h b/src/old/tests/param.h index 2756b69..2756b69 100644 --- a/src/tests/param.h +++ b/src/old/tests/param.h | |||
diff --git a/src/tests/plugin/main.cpp b/src/old/tests/plugin/main.cpp index 51c8390..51c8390 100644 --- a/src/tests/plugin/main.cpp +++ b/src/old/tests/plugin/main.cpp | |||
diff --git a/src/tests/plugin/plugin.cpp b/src/old/tests/plugin/plugin.cpp index ea558fd..ea558fd 100644 --- a/src/tests/plugin/plugin.cpp +++ b/src/old/tests/plugin/plugin.cpp | |||
diff --git a/src/tests/plugin/plugin.h b/src/old/tests/plugin/plugin.h index f726867..f726867 100644 --- a/src/tests/plugin/plugin.h +++ b/src/old/tests/plugin/plugin.h | |||
diff --git a/src/tests/qsort.cpp b/src/old/tests/qsort.cpp index 28c6f03..28c6f03 100644 --- a/src/tests/qsort.cpp +++ b/src/old/tests/qsort.cpp | |||
diff --git a/src/tests/sbuffer.cpp b/src/old/tests/sbuffer.cpp index 02798cb..02798cb 100644 --- a/src/tests/sbuffer.cpp +++ b/src/old/tests/sbuffer.cpp | |||
diff --git a/src/tests/serialize.cpp b/src/old/tests/serialize.cpp index e233704..e233704 100644 --- a/src/tests/serialize.cpp +++ b/src/old/tests/serialize.cpp | |||
diff --git a/src/tests/serializetext.cpp b/src/old/tests/serializetext.cpp index f6be7d3..f6be7d3 100644 --- a/src/tests/serializetext.cpp +++ b/src/old/tests/serializetext.cpp | |||
diff --git a/src/tests/sha1.cpp b/src/old/tests/sha1.cpp index df3113c..df3113c 100644 --- a/src/tests/sha1.cpp +++ b/src/old/tests/sha1.cpp | |||
diff --git a/src/tests/sptr.cpp b/src/old/tests/sptr.cpp index 252463b..38d3675 100644 --- a/src/tests/sptr.cpp +++ b/src/old/tests/sptr.cpp | |||
@@ -9,12 +9,12 @@ public: | |||
9 | printf("Created.\n"); | 9 | printf("Created.\n"); |
10 | } | 10 | } |
11 | 11 | ||
12 | virtual ~Annoy() | 12 | ~Annoy() |
13 | { | 13 | { |
14 | printf("Destroyed.\n"); | 14 | printf("Destroyed.\n"); |
15 | } | 15 | } |
16 | 16 | ||
17 | virtual void go() | 17 | void go() |
18 | { | 18 | { |
19 | printf("%d: I'm annoying.\n", ++nCnt); | 19 | printf("%d: I'm annoying.\n", ++nCnt); |
20 | } | 20 | } |
@@ -22,22 +22,6 @@ public: | |||
22 | int nCnt; | 22 | int nCnt; |
23 | }; | 23 | }; |
24 | 24 | ||
25 | class Annoy2: public Annoy | ||
26 | { | ||
27 | public: | ||
28 | Annoy2(){}; | ||
29 | virtual ~Annoy2(){}; | ||
30 | virtual void go() | ||
31 | { | ||
32 | printf("{{I'm Annoy2!!}} "); | ||
33 | Annoy::go(); | ||
34 | } | ||
35 | virtual void go2() | ||
36 | { | ||
37 | printf("This is me, on my own...\n"); | ||
38 | } | ||
39 | }; | ||
40 | |||
41 | void beAnnoying( SPtr<Annoy> bob ) | 25 | void beAnnoying( SPtr<Annoy> bob ) |
42 | { | 26 | { |
43 | printf("bob-Count: %d\n", bob.count() ); | 27 | printf("bob-Count: %d\n", bob.count() ); |
@@ -46,7 +30,7 @@ void beAnnoying( SPtr<Annoy> bob ) | |||
46 | 30 | ||
47 | int main() | 31 | int main() |
48 | { | 32 | { |
49 | SPtr<Annoy> pt( new Annoy2 ); | 33 | SPtr<Annoy> pt( new Annoy ); |
50 | printf("Count: %d\n", pt.count() ); | 34 | printf("Count: %d\n", pt.count() ); |
51 | pt->go(); | 35 | pt->go(); |
52 | 36 | ||
@@ -63,14 +47,6 @@ int main() | |||
63 | pt3->go(); | 47 | pt3->go(); |
64 | 48 | ||
65 | beAnnoying( pt3 ); | 49 | beAnnoying( pt3 ); |
66 | |||
67 | { | ||
68 | SPtr<Annoy2> pt4( SPtrCast<Annoy2>( pt3 ) ); | ||
69 | printf("Count: %d\n", pt4.count() ); | ||
70 | |||
71 | pt4->go2(); | ||
72 | } | ||
73 | printf("Count: %d\n", pt.count() ); | ||
74 | } | 50 | } |
75 | printf("Count: %d\n", pt.count() ); | 51 | printf("Count: %d\n", pt.count() ); |
76 | } | 52 | } |
diff --git a/src/tests/srvstress.cpp b/src/old/tests/srvstress.cpp index d9a9a1c..d9a9a1c 100644 --- a/src/tests/srvstress.cpp +++ b/src/old/tests/srvstress.cpp | |||
diff --git a/src/tests/strhash.cpp b/src/old/tests/strhash.cpp index f6528ca..f6528ca 100644 --- a/src/tests/strhash.cpp +++ b/src/old/tests/strhash.cpp | |||
diff --git a/src/tests/teltest/main.cpp b/src/old/tests/teltest/main.cpp index 5d3ec26..5d3ec26 100644 --- a/src/tests/teltest/main.cpp +++ b/src/old/tests/teltest/main.cpp | |||
diff --git a/src/tests/teltest/telnetmonitor.cpp b/src/old/tests/teltest/telnetmonitor.cpp index 65954eb..65954eb 100644 --- a/src/tests/teltest/telnetmonitor.cpp +++ b/src/old/tests/teltest/telnetmonitor.cpp | |||
diff --git a/src/tests/teltest/telnetmonitor.h b/src/old/tests/teltest/telnetmonitor.h index ba5761e..ba5761e 100644 --- a/src/tests/teltest/telnetmonitor.h +++ b/src/old/tests/teltest/telnetmonitor.h | |||
diff --git a/src/tests/xmlreadtest.cpp b/src/old/tests/xmlreadtest.cpp index d061810..d061810 100644 --- a/src/tests/xmlreadtest.cpp +++ b/src/old/tests/xmlreadtest.cpp | |||
diff --git a/src/tests/xmlrepltest.cpp b/src/old/tests/xmlrepltest.cpp index 9667705..9667705 100644 --- a/src/tests/xmlrepltest.cpp +++ b/src/old/tests/xmlrepltest.cpp | |||
diff --git a/src/tests/xmlwritetest.cpp b/src/old/tests/xmlwritetest.cpp index a22d19d..a22d19d 100644 --- a/src/tests/xmlwritetest.cpp +++ b/src/old/tests/xmlwritetest.cpp | |||