89 //Create csvReference |
89 //Create csvReference |
90 CCsvReader csvReference; |
90 CCsvReader csvReference; |
91 TInt size = 0; |
91 TInt size = 0; |
92 //get the size of the reference file |
92 //get the size of the reference file |
93 #ifdef __WINSCW__ |
93 #ifdef __WINSCW__ |
94 TInt error = CsvFileSize(KReferenceWinscwCsvFile, size); |
94 TInt error = CsvFileSizeL(KReferenceWinscwCsvFile, size); |
95 #else |
95 #else |
96 TInt error = CsvFileSize(KReferenceCsvFile, size); |
96 TInt error = CsvFileSizeL(KReferenceCsvFile, size); |
97 #endif |
97 #endif |
98 if(error) |
98 if(error) |
99 { |
99 { |
100 SetBlockResult(EFail); |
100 SetBlockResult(EFail); |
101 INFO_PRINTF2(_L("TestBaselineCsv, KReferenceCsvFile, test failed on with error code %d"), error); |
101 INFO_PRINTF2(_L("TestBaselineCsvL, KReferenceCsvFile, test failed on with error code %d"), error); |
102 } |
102 } |
103 //Set the size of the RBuf |
103 //Set the size of the RBuf |
104 csvReference.Create(size); |
104 csvReference.Create(size); |
105 |
105 |
106 //Create csvGenerated |
106 //Create csvGenerated |
107 CCsvReader csvGenerated; |
107 CCsvReader csvGenerated; |
108 //get the size of the generated file |
108 //get the size of the generated file |
109 error = CsvFileSize(KApiCSVFile, size); |
109 error = CsvFileSizeL(KApiCSVFile, size); |
110 if(error) |
110 if(error) |
111 { |
111 { |
112 SetBlockResult(EFail); |
112 SetBlockResult(EFail); |
113 INFO_PRINTF2(_L("TestBaselineCsv, KApiCSVFile, test failed on with error code %d"), error); |
113 INFO_PRINTF2(_L("TestBaselineCsvL, KApiCSVFile, test failed on with error code %d"), error); |
114 } |
114 } |
115 //create the RBuf |
115 //create the RBuf |
116 csvGenerated.Create(size); |
116 csvGenerated.Create(size); |
117 |
117 |
118 //Read the reference file into the RBuf |
118 //Read the reference file into the RBuf |
119 #ifdef __WINSCW__ |
119 #ifdef __WINSCW__ |
120 error = ReadCsvFile(KReferenceWinscwCsvFile, csvReference.Buffer()); |
120 error = ReadCsvFileL(KReferenceWinscwCsvFile, csvReference.Buffer()); |
121 #else |
121 #else |
122 error = ReadCsvFile(KReferenceCsvFile, csvReference.Buffer()); |
122 error = ReadCsvFileL(KReferenceCsvFile, csvReference.Buffer()); |
123 #endif |
123 #endif |
124 if(error) |
124 if(error) |
125 { |
125 { |
126 SetBlockResult(EFail); |
126 SetBlockResult(EFail); |
127 INFO_PRINTF2(_L("TestBaselineCsv, ReadCsvFile(KReferenceCsvFile) failed on with error code %d"), error); |
127 INFO_PRINTF2(_L("TestBaselineCsvL, ReadCsvFileL(KReferenceCsvFile) failed on with error code %d"), error); |
128 } |
128 } |
129 //Read the generated file into the RBuf |
129 //Read the generated file into the RBuf |
130 error = ReadCsvFile(KApiCSVFile, csvGenerated.Buffer()); |
130 error = ReadCsvFileL(KApiCSVFile, csvGenerated.Buffer()); |
131 if(error) |
131 if(error) |
132 { |
132 { |
133 SetBlockResult(EFail); |
133 SetBlockResult(EFail); |
134 INFO_PRINTF2(_L("TestBaselineCsv, ReadCsvFile(KApiCSVFile) failed on with error code %d"), error); |
134 INFO_PRINTF2(_L("TestBaselineCsvL, ReadCsvFileL(KApiCSVFile) failed on with error code %d"), error); |
135 } |
135 } |
136 |
136 |
137 //compare the two files |
137 //compare the two files |
138 if(!error) |
138 if(!error) |
139 { |
139 { |
187 /* |
187 /* |
188 * Read a file and stick the data in a buffer and return that. |
188 * Read a file and stick the data in a buffer and return that. |
189 * The caller of the method owns the buffer |
189 * The caller of the method owns the buffer |
190 * Ie. this method allocates the buffer but the caller is responsible for destroying it. |
190 * Ie. this method allocates the buffer but the caller is responsible for destroying it. |
191 */ |
191 */ |
192 TInt COutputCSVSanityWrapper::ReadCsvFile(const TDesC& aFilename, RBuf8& aBuffer) |
192 TInt COutputCSVSanityWrapper::ReadCsvFileL(const TDesC& aFilename, RBuf8& aBuffer) |
193 { |
193 { |
194 RFs fsSession; |
194 RFs fsSession; |
195 CleanupClosePushL(fsSession); |
195 CleanupClosePushL(fsSession); |
196 User::LeaveIfError(fsSession.Connect()); |
196 User::LeaveIfError(fsSession.Connect()); |
197 |
197 |