aboutsummaryrefslogtreecommitdiff
path: root/src/unit/myriad.unit
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-01-20 18:09:04 +0000
committerMike Buland <eichlan@xagasoft.com>2011-01-20 18:09:04 +0000
commit393f1b414746a7f1977971dd7659dd2b47092b11 (patch)
tree81d0ca1ee70ab86a7d79c1991abe5c387b655fb2 /src/unit/myriad.unit
parentc259f95bd0e58b247940a339bb9b4b401b4e9438 (diff)
parent7e25a863325dc3e9762397e700030969e093b087 (diff)
downloadlibbu++-393f1b414746a7f1977971dd7659dd2b47092b11.tar.gz
libbu++-393f1b414746a7f1977971dd7659dd2b47092b11.tar.bz2
libbu++-393f1b414746a7f1977971dd7659dd2b47092b11.tar.xz
libbu++-393f1b414746a7f1977971dd7659dd2b47092b11.zip
Wow! Merged the branch, streams are updated, and there's no more FString, run
the fixstrings.sh script in the support directory to (hopefully) automatically update your projects.
Diffstat (limited to '')
-rw-r--r--src/unit/myriad.unit22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/unit/myriad.unit b/src/unit/myriad.unit
index ad8fb5d..e0f7ef4 100644
--- a/src/unit/myriad.unit
+++ b/src/unit/myriad.unit
@@ -1,12 +1,12 @@
1// vim: syntax=cpp 1// vim: syntax=cpp
2/* 2/*
3 * Copyright (C) 2007-2010 Xagasoft, All rights reserved. 3 * Copyright (C) 2007-2011 Xagasoft, All rights reserved.
4 * 4 *
5 * This file is part of the libbu++ library and is released under the 5 * This file is part of the libbu++ library and is released under the
6 * terms of the license contained in the file LICENSE. 6 * terms of the license contained in the file LICENSE.
7 */ 7 */
8 8
9#include "bu/fstring.h" 9#include "bu/string.h"
10#include "bu/file.h" 10#include "bu/file.h"
11#include "bu/myriad.h" 11#include "bu/myriad.h"
12#include "bu/myriadstream.h" 12#include "bu/myriadstream.h"
@@ -56,7 +56,7 @@ Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const VerifyObject &vo )
56 { 56 {
57 int iRand = random()%128; 57 int iRand = random()%128;
58// ar << iRand; 58// ar << iRand;
59 Bu::FString sDat( iRand ); 59 Bu::String sDat( iRand );
60 for( int j = 0; j < iRand; j++ ) 60 for( int j = 0; j < iRand; j++ )
61 sDat[j] = (char)((uint8_t)(random()%256)); 61 sDat[j] = (char)((uint8_t)(random()%256));
62 ar << sDat; 62 ar << sDat;
@@ -64,7 +64,7 @@ Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const VerifyObject &vo )
64 sum.addData( sDat.getStr(), iRand ); 64 sum.addData( sDat.getStr(), iRand );
65 vo.iBytesWritten += 4 + iRand; 65 vo.iBytesWritten += 4 + iRand;
66 } 66 }
67 Bu::FString sRes = sum.getResult(); 67 Bu::String sRes = sum.getResult();
68 ar << sRes; 68 ar << sRes;
69 vo.iBytesWritten += 4 + sRes.getSize(); 69 vo.iBytesWritten += 4 + sRes.getSize();
70 return ar; 70 return ar;
@@ -79,13 +79,13 @@ Bu::ArchiveBase &operator>>( Bu::ArchiveBase &ar, VerifyObject &vo )
79 { 79 {
80 int iRand; 80 int iRand;
81// ar >> iRand; 81// ar >> iRand;
82 Bu::FString sStr; 82 Bu::String sStr;
83 ar >> sStr; 83 ar >> sStr;
84 iRand = sStr.getSize(); 84 iRand = sStr.getSize();
85 sum.addData( &iRand, 4 ); 85 sum.addData( &iRand, 4 );
86 sum.addData( sStr.getStr(), iRand ); 86 sum.addData( sStr.getStr(), iRand );
87 } 87 }
88 Bu::FString sSum; 88 Bu::String sSum;
89 ar >> sSum; 89 ar >> sSum;
90 unitTest( sSum == sum.getResult() ); 90 unitTest( sSum == sum.getResult() );
91 int iTooMuch; 91 int iTooMuch;
@@ -104,7 +104,7 @@ suite Myriad
104{ 104{
105 test setSize 105 test setSize
106 { 106 {
107 FString sFileName("myriad-XXXXXXX"); 107 String sFileName("myriad-XXXXXXX");
108 108
109 File fMyriad = tempFile( sFileName ); 109 File fMyriad = tempFile( sFileName );
110 Myriad m( fMyriad, 32 ); 110 Myriad m( fMyriad, 32 );
@@ -194,7 +194,7 @@ suite Myriad
194 194
195 test stressGrow 195 test stressGrow
196 { 196 {
197 FString sFileName("myriad-XXXXXXX"); 197 String sFileName("myriad-XXXXXXX");
198 198
199 File fMyriad = tempFile( sFileName ); 199 File fMyriad = tempFile( sFileName );
200 Myriad m( fMyriad ); 200 Myriad m( fMyriad );
@@ -256,7 +256,7 @@ suite Myriad
256 256
257 test stressTruncate 257 test stressTruncate
258 { 258 {
259 FString sFileName("myriad-XXXXXXX"); 259 String sFileName("myriad-XXXXXXX");
260 260
261 File fMyriad = tempFile( sFileName ); 261 File fMyriad = tempFile( sFileName );
262 Myriad m( fMyriad ); 262 Myriad m( fMyriad );
@@ -289,7 +289,7 @@ suite Myriad
289 289
290 test stressTruncate2 290 test stressTruncate2
291 { 291 {
292 FString sFileName("myriad-XXXXXXX"); 292 String sFileName("myriad-XXXXXXX");
293 293
294 Array<int> aStream; 294 Array<int> aStream;
295 295
@@ -329,7 +329,7 @@ suite Myriad
329 329
330 test stressArchive 330 test stressArchive
331 { 331 {
332 FString sFileName("myriad-XXXXXX"); 332 String sFileName("myriad-XXXXXX");
333 Array<int> aStream; 333 Array<int> aStream;
334 334
335 srandom( 2096 ); 335 srandom( 2096 );