31
|
1 |
|
|
2 |
#include <string>
|
|
3 |
#include <iostream>
|
|
4 |
#include <fstream>
|
|
5 |
#include <list>
|
|
6 |
|
|
7 |
|
|
8 |
#ifndef STLPORT
|
|
9 |
//#error You Did not get the STLport include files!
|
|
10 |
#endif
|
|
11 |
|
|
12 |
using namespace std;
|
|
13 |
|
|
14 |
int c_test (int/* argc*/, char **/*argv[]*/)
|
|
15 |
{
|
|
16 |
|
|
17 |
#ifdef STLPORT
|
|
18 |
string s2 = "STLport included";
|
|
19 |
cout << s2 << endl;
|
|
20 |
#else
|
|
21 |
string s2 = "STLport NOT included!";
|
|
22 |
cout << s2 << endl;
|
|
23 |
#endif
|
|
24 |
|
|
25 |
int failures = 0;
|
|
26 |
|
|
27 |
string s = "hello";
|
|
28 |
cout << s << endl;
|
|
29 |
ofstream fstr("testfile");
|
|
30 |
fstr << s << endl;
|
|
31 |
|
|
32 |
list<int> L;
|
|
33 |
for (int i = 0; i < 10; ++i) {
|
|
34 |
L.push_back(i);
|
|
35 |
}
|
|
36 |
//for comparing results
|
|
37 |
int i = 9;
|
|
38 |
for (list<int>::const_reverse_iterator cri = L.rbegin();
|
|
39 |
cri != (list<int>::const_reverse_iterator) L.rend(); ++cri) {
|
|
40 |
cout << *cri << endl;
|
|
41 |
if(*cri != i)
|
|
42 |
failures++;
|
|
43 |
i--;
|
|
44 |
}
|
|
45 |
#ifndef __SYMBIAN32__
|
|
46 |
|
|
47 |
#ifdef STLPORT
|
|
48 |
string s3 = "PASSED";
|
|
49 |
if (strstr(argv[0], "nostlport"))
|
|
50 |
s3 = "FAILED";
|
|
51 |
cout << s3 << endl;
|
|
52 |
#else
|
|
53 |
string s3 = "PASSED";
|
|
54 |
if (!strstr(argv[0], "nostlport"))
|
|
55 |
s3 = "FAILED";
|
|
56 |
cout << s3 << endl;
|
|
57 |
#endif
|
|
58 |
|
|
59 |
#endif
|
|
60 |
if (!failures)
|
|
61 |
return 0;
|
|
62 |
else
|
|
63 |
return 1;
|
|
64 |
|
|
65 |
}
|
|
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
|
73 |
|
|
74 |
|
|
75 |
|