aboutsummaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/tests/sharedcore.cpp24
-rw-r--r--src/tests/speed.cpp5
2 files changed, 16 insertions, 13 deletions
diff --git a/src/tests/sharedcore.cpp b/src/tests/sharedcore.cpp
index bdfde4c..9f65ac5 100644
--- a/src/tests/sharedcore.cpp
+++ b/src/tests/sharedcore.cpp
@@ -12,42 +12,42 @@ class Shint : public Bu::SharedCore<struct ShintCore>
12public: 12public:
13 Shint() 13 Shint()
14 { 14 {
15 data->val = 0; 15 core->val = 0;
16 } 16 }
17 17
18 Shint( int val ) 18 Shint( int val )
19 { 19 {
20 data->val = val; 20 core->val = val;
21 } 21 }
22 22
23 int getVal() 23 int getVal() const
24 { 24 {
25 return data->val; 25 return core->val;
26 } 26 }
27 27
28 void setValBad( int val ) 28 void setValBad( int val )
29 { 29 {
30 data->val = val; 30 core->val = val;
31 } 31 }
32 32
33 void setVal( int val ) 33 void setVal( int val )
34 { 34 {
35 _hardCopy(); 35 _hardCopy();
36 data->val = val; 36 core->val = val;
37 } 37 }
38 38
39 bool operator==( const Shint &rhs ) 39 bool operator==( const Shint &rhs )
40 { 40 {
41 if( data == rhs.data ) 41 if( core == rhs.core )
42 { 42 {
43 sio << "Same pointer (" << Fmt::ptr() << data << ")" << sio.nl; 43 sio << "Same pointer (" << Fmt::ptr() << core << ")" << sio.nl;
44 return true; 44 return true;
45 } 45 }
46 if( data->val == rhs.data->val ) 46 if( core->val == rhs.core->val )
47 { 47 {
48 sio << "Same value " << data->val << " (" 48 sio << "Same value " << core->val << " ("
49 << Fmt::ptr() << data << " vs " 49 << Fmt::ptr() << core << " vs "
50 << Fmt::ptr() << rhs.data << ")" 50 << Fmt::ptr() << rhs.core << ")"
51 << sio.nl; 51 << sio.nl;
52 return true; 52 return true;
53 } 53 }
diff --git a/src/tests/speed.cpp b/src/tests/speed.cpp
index b8924d7..5b26dd3 100644
--- a/src/tests/speed.cpp
+++ b/src/tests/speed.cpp
@@ -43,6 +43,9 @@ void fullTest( tst t )
43 43
44int main() 44int main()
45{ 45{
46 fullTest( tstCopy<Bu::FString>("This is a test string.") ); 46 Bu::FString str;
47 for( int j = 0; j < 500; j++ )
48 str.append("Hey, this is a test string. It will be reapeated many, many times. How's that?");
49 fullTest( tstCopy<Bu::FString>( str ) );
47} 50}
48 51