ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/test/io/IfstrstreamTestCase.cpp
Revision: 1584
Committed: Fri Oct 15 21:11:35 2004 UTC (19 years, 8 months ago) by tim
File size: 1997 byte(s)
Log Message:
adding test file

File Contents

# Content
1 #include <iostream>
2 #include <string>
3
4 #include "io/basic_ifstrstream.hpp"
5 #include "IfstrstreamTestCase.hpp"
6
7 // Registers the fixture into the 'registry'
8
9 using namespace std;
10 using namespace oopse;
11 CPPUNIT_TEST_SUITE_REGISTRATION( IfstrstreamTestCase );
12
13 #ifndef IS_MPI
14 void IfstrstreamTestCase::setUp() {
15
16
17 }
18
19 void IfstrstreamTestCase::tearDown() {
20
21 }
22
23
24 void IfstrstreamTestCase::testConstructor() {
25 ifstrstream fin1;
26 fin1.open("DUFF.frc");
27 CPPUNIT_ASSERT(fin1.is_open());
28
29 ifstrstream fin2;
30 fin2.open("NonExistFile");
31 CPPUNIT_ASSERT(!fin2.is_open());
32
33 ifstrstream fin3("DUFF.frc");
34 CPPUNIT_ASSERT(fin3.is_open());
35
36 ifstrstream fin4("NonExistFile");
37 CPPUNIT_ASSERT(!fin4.is_open());
38 }
39
40 void IfstrstreamTestCase::testOpen() {
41 const int MAXLEN = 1024;
42 char buffer[MAXLEN];
43
44 string firstLine = "! This is the forcefield file for the Dipolar Unified-atom Force Field (DUFF).";
45
46 ifstrstream fin1;
47 fin1.open("DUFF.frc");
48
49 fin1.getline(buffer, MAXLEN);
50 CPPUNIT_ASSERT(buffer == firstLine);
51 cout << buffer;
52 }
53
54 void IfstrstreamTestCase::testIs_open() {
55
56 }
57
58 void IfstrstreamTestCase::testClose() {
59
60 }
61
62 #else
63 void IfstrstreamTestCase::setUp() {
64
65 }
66
67 void IfstrstreamTestCase::tearDown() {
68
69 }
70
71 void IfstrstreamTestCase::testMasterConstructor() {
72 const int MAXLEN = 1024;
73 char buffer[MAXLEN];
74
75 string firstLine = "! This is the forcefield file for the Dipolar Unified-atom Force Field (DUFF).";
76
77 ifstrstream fin1;
78 fin1.open("DUFF.frc");
79
80 fin1.getline(buffer, MAXLEN);
81 CPPUNIT_ASSERT(buffer == firstLine);
82 cout << buffer;
83
84 }
85
86 void IfstrstreamTestCase::testMasterOpen() {
87
88 }
89
90 void IfstrstreamTestCase::testMasterIs_open() {
91
92 }
93
94 void IfstrstreamTestCase::testMasterClose() {
95
96
97 }
98
99 void IfstrstreamTestCase::testSlaveConstructor() {
100
101 }
102
103 void IfstrstreamTestCase::testSlaveOpen() {
104
105 }
106
107 void IfstrstreamTestCase::testSlaveIs_open() {
108
109 }
110
111 void IfstrstreamTestCase::testSlaveClose() {
112
113
114 }
115 #endif

Properties

Name Value
svn:executable *