[haiku-commits] haiku: hrev47347 - in src: tests/system/kernel/util tests/kits/storage tests/kits/interface tests/add-ons/translators/stxttranslator bin/makeudfimage

  • From: zooey@xxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 11 Jun 2014 11:43:36 +0200 (CEST)

hrev47347 adds 2 changesets to branch 'master'
old head: 006637a9b64592ff3fa679f497e064e0aa99e9bd
new head: 77aa0e2a5ef8e6d00570dbeb7a12aeb23e9e5cf0
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=77aa0e2+%5E006637a

----------------------------------------------------------------------------

bab4c96: Fix build problems of makeudfimage with gcc4.
  
  * _ALLOCATOR_H clashes with a std-include provided by gcc.
  * add using declaration for std::list.

77aa0e2: Fix build of unit-tests with gcc4.

                                    [ Oliver Tappe <zooey@xxxxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

36 files changed, 129 insertions(+), 84 deletions(-)
src/bin/makeudfimage/Allocator.h                 |  7 +++--
.../stxttranslator/STXTTranslatorTest.cpp        | 23 ++++++++------
.../kits/app/broster/LaunchTesterHelper.cpp      |  2 +-
src/tests/kits/interface/balert/AlertTest.cpp    |  4 ++-
.../interface/bdeskbar/DeskbarAddItemTest.cpp    |  2 ++
.../interface/bdeskbar/DeskbarGetItemTest.cpp    |  2 ++
.../interface/bdeskbar/DeskbarLocationTest.cpp   |  2 ++
.../interface/bpolygon/CreatePolygonTest.cpp     |  2 ++
.../kits/interface/bpolygon/MapPolygonTest.cpp   |  2 ++
.../interface/bregion/RegionConstruction.cpp     |  2 ++
.../kits/interface/bregion/RegionExclude.cpp     |  2 ++
.../kits/interface/bregion/RegionInclude.cpp     |  2 ++
.../kits/interface/bregion/RegionIntersect.cpp   |  2 ++
.../kits/interface/bregion/RegionOffsetBy.cpp    |  2 ++
.../kits/interface/bregion/RegionTestcase.cpp    |  2 ++
src/tests/kits/storage/BasicTest.cpp             |  6 ++--
src/tests/kits/storage/BasicTest.h               |  7 ++++-
src/tests/kits/storage/DirectoryTest.cpp         |  5 ++-
src/tests/kits/storage/EntryTest.cpp             |  9 ++++--
src/tests/kits/storage/FindDirectoryTest.cpp     |  5 ++-
src/tests/kits/storage/MimeSnifferTest.cpp       | 13 +++++---
src/tests/kits/storage/NodeInfoTest.cpp          |  5 ++-
src/tests/kits/storage/PathTest.cpp              |  6 +++-
src/tests/kits/storage/QueryTest.cpp             |  2 ++
src/tests/kits/storage/ResourcesTest.cpp         |  6 +++-
src/tests/kits/storage/StatableTest.h            | 12 ++++----
src/tests/kits/storage/SymLinkTest.cpp           |  3 ++
src/tests/kits/storage/TestApp.cpp               |  1 +
src/tests/kits/translation/BitmapStreamTest.cpp  |  5 ++-
.../kits/translation/TranslationUtilsTest.cpp    |  4 ++-
.../kits/translation/TranslatorRosterTest.cpp    |  1 +
.../system/kernel/util/DoublyLinkedListTest.cpp  |  3 +-
src/tests/system/kernel/util/OrderedMapTest.h    | 32 ++------------------
src/tests/system/kernel/util/VectorMapTest.cpp   |  2 +-
src/tests/system/kernel/util/VectorSetTest.cpp   |  5 +--
src/tests/system/kernel/util/VectorTest.cpp      | 23 +++++++-------

############################################################################

Commit:      bab4c96c5c9be8f35dfc7556157e98827129f2fc
URL:         http://cgit.haiku-os.org/haiku/commit/?id=bab4c96
Author:      Oliver Tappe <zooey@xxxxxxxxxxxxxxx>
Date:        Wed Jun 11 09:42:41 2014 UTC

Fix build problems of makeudfimage with gcc4.

* _ALLOCATOR_H clashes with a std-include provided by gcc.
* add using declaration for std::list.

----------------------------------------------------------------------------

diff --git a/src/bin/makeudfimage/Allocator.h b/src/bin/makeudfimage/Allocator.h
index ec58bac..1704613 100644
--- a/src/bin/makeudfimage/Allocator.h
+++ b/src/bin/makeudfimage/Allocator.h
@@ -10,10 +10,11 @@
        Physical block allocator class declarations.
 */
 
-#ifndef _ALLOCATOR_H
-#define _ALLOCATOR_H
+#ifndef _UDF_ALLOCATOR_H
+#define _UDF_ALLOCATOR_H
 
 #include <list>
+using std::list;
 
 #include "UdfStructures.h"
 
@@ -49,4 +50,4 @@ private:
        status_t fInitStatus;
 };
 
-#endif // _ALLOCATOR_H
+#endif // _UDF_ALLOCATOR_H

############################################################################

Revision:    hrev47347
Commit:      77aa0e2a5ef8e6d00570dbeb7a12aeb23e9e5cf0
URL:         http://cgit.haiku-os.org/haiku/commit/?id=77aa0e2
Author:      Oliver Tappe <zooey@xxxxxxxxxxxxxxx>
Date:        Wed Jun 11 09:43:12 2014 UTC

Fix build of unit-tests with gcc4.

----------------------------------------------------------------------------

diff --git 
a/src/tests/add-ons/translators/stxttranslator/STXTTranslatorTest.cpp 
b/src/tests/add-ons/translators/stxttranslator/STXTTranslatorTest.cpp
index c9c452a..62cc598 100644
--- a/src/tests/add-ons/translators/stxttranslator/STXTTranslatorTest.cpp
+++ b/src/tests/add-ons/translators/stxttranslator/STXTTranslatorTest.cpp
@@ -212,18 +212,21 @@ TranslateTests(STXTTranslatorTest *ptest, 
BTranslatorRoster *proster,
        styled_path = new char[nlongest + 6];
        plain_path = new char[nlongest + 6];
        
+       BFile styled_file, plain_file;
+
        // Perform translations on every file in the array
        for (int32 i = 0; i < len; i++) {
                strcpy(styled_path, paths[i]);
                strcat(styled_path, ".stxt");
                strcpy(plain_path, paths[i]);
                strcat(plain_path, ".txt");
-               
-               // Setup input files    
+
+               // Setup input files
                ptest->NextSubTest();
-               BFile styled_file, plain_file, *pinput_file;
                CPPUNIT_ASSERT(styled_file.SetTo(styled_path, B_READ_ONLY) == 
B_OK);
                CPPUNIT_ASSERT(plain_file.SetTo(plain_path, B_READ_ONLY) == 
B_OK);
+
+               BFile *pinput_file;
                if (bplain) {
                        printf(" [%s] ", plain_path);
                        pinput_file = &plain_file;
@@ -231,9 +234,9 @@ TranslateTests(STXTTranslatorTest *ptest, BTranslatorRoster 
*proster,
                        printf(" [%s] ", styled_path);
                        pinput_file = &styled_file;
                }
-               
+
                BMallocIO mallio, dmallio;
-               
+
                // Convert to B_TRANSLATOR_ANY_TYPE (should be 
B_TRANSLATOR_TEXT)
                ptest->NextSubTest();
                CPPUNIT_ASSERT(mallio.Seek(0, SEEK_SET) == 0);
@@ -241,7 +244,7 @@ TranslateTests(STXTTranslatorTest *ptest, BTranslatorRoster 
*proster,
                CPPUNIT_ASSERT(proster->Translate(pinput_file, NULL, NULL, 
&mallio,
                        B_TRANSLATOR_ANY_TYPE) == B_OK);
                CPPUNIT_ASSERT(CompareStreams(mallio, plain_file) == true);
-               
+
                // Convert to B_TRANSLATOR_TEXT
                ptest->NextSubTest();
                CPPUNIT_ASSERT(mallio.Seek(0, SEEK_SET) == 0);
@@ -249,7 +252,7 @@ TranslateTests(STXTTranslatorTest *ptest, BTranslatorRoster 
*proster,
                CPPUNIT_ASSERT(proster->Translate(pinput_file, NULL, NULL, 
&mallio,
                        B_TRANSLATOR_TEXT) == B_OK);
                CPPUNIT_ASSERT(CompareStreams(mallio, plain_file) == true);
-               
+
                // Convert plain mallio to B_TRANSLATOR_TEXT dmallio
                ptest->NextSubTest();
                CPPUNIT_ASSERT(dmallio.Seek(0, SEEK_SET) == 0);
@@ -257,7 +260,7 @@ TranslateTests(STXTTranslatorTest *ptest, BTranslatorRoster 
*proster,
                CPPUNIT_ASSERT(proster->Translate(&mallio, NULL, NULL, &dmallio,
                        B_TRANSLATOR_TEXT) == B_OK);
                CPPUNIT_ASSERT(CompareStreams(dmallio, plain_file) == true);
-               
+
                // Convert to B_STYLED_TEXT_FORMAT
                ptest->NextSubTest();
                CPPUNIT_ASSERT(mallio.Seek(0, SEEK_SET) == 0);
@@ -265,7 +268,7 @@ TranslateTests(STXTTranslatorTest *ptest, BTranslatorRoster 
*proster,
                CPPUNIT_ASSERT(proster->Translate(pinput_file, NULL, NULL, 
&mallio,
                        B_STYLED_TEXT_FORMAT) == B_OK);
                CPPUNIT_ASSERT(CompareStreams(mallio, styled_file) == true);
-               
+
                // Convert styled mallio to B_TRANSLATOR_TEXT dmallio
                ptest->NextSubTest();
                CPPUNIT_ASSERT(dmallio.Seek(0, SEEK_SET) == 0);
@@ -273,7 +276,7 @@ TranslateTests(STXTTranslatorTest *ptest, BTranslatorRoster 
*proster,
                CPPUNIT_ASSERT(proster->Translate(&mallio, NULL, NULL, &dmallio,
                        B_TRANSLATOR_TEXT) == B_OK);
                CPPUNIT_ASSERT(CompareStreams(dmallio, plain_file) == true);
-               
+
                // Convert styled mallio to B_STYLED_TEXT_FORMAT dmallio
                ptest->NextSubTest();
                CPPUNIT_ASSERT(dmallio.Seek(0, SEEK_SET) == 0);
diff --git a/src/tests/kits/app/broster/LaunchTesterHelper.cpp 
b/src/tests/kits/app/broster/LaunchTesterHelper.cpp
index c72771c..d75707d 100644
--- a/src/tests/kits/app/broster/LaunchTesterHelper.cpp
+++ b/src/tests/kits/app/broster/LaunchTesterHelper.cpp
@@ -341,7 +341,7 @@ LaunchContext::AppMessengerFor(team_id team) const
 {
        BAutolock _lock(fLock);
        BMessenger result;
-       if (AppInfo *info = AppInfoFor(team)) {
+       if (AppInfoFor(team)) {
                // We need to do some hacking.
                BMessenger messenger;
                struct fake_messenger {
diff --git a/src/tests/kits/interface/balert/AlertTest.cpp 
b/src/tests/kits/interface/balert/AlertTest.cpp
index d4bd6bf..07b27fc 100644
--- a/src/tests/kits/interface/balert/AlertTest.cpp
+++ b/src/tests/kits/interface/balert/AlertTest.cpp
@@ -3,7 +3,6 @@
 #include <cppunit/Test.h>
 #include <cppunit/TestCaller.h>
 #include <cppunit/TestSuite.h>
-#include <iostream.h>
 #include <stdio.h>
 #include <string.h>
 #include <Application.h>
@@ -13,6 +12,9 @@
 #include <Button.h>
 #include <Rect.h>
 
+#include <iostream>
+using std::ostream;
+
 #define ASSERT_DEQUAL(x,y) CPPUNIT_ASSERT_DOUBLES_EQUAL((x),(y),0.01)
 
 const char *k20X = "XXXXXXXXXXXXXXXXXXXX";
diff --git a/src/tests/kits/interface/bdeskbar/DeskbarAddItemTest.cpp 
b/src/tests/kits/interface/bdeskbar/DeskbarAddItemTest.cpp
index 5020813..9f74871 100644
--- a/src/tests/kits/interface/bdeskbar/DeskbarAddItemTest.cpp
+++ b/src/tests/kits/interface/bdeskbar/DeskbarAddItemTest.cpp
@@ -17,6 +17,8 @@
 #include <Entry.h>
 #include <image.h>
 
+#include <assert.h>
+
 
 const char *appName = "application/x-vnd.jsr-additemtest";
 const char *pulsePath = "/boot/system/apps/Pulse";
diff --git a/src/tests/kits/interface/bdeskbar/DeskbarGetItemTest.cpp 
b/src/tests/kits/interface/bdeskbar/DeskbarGetItemTest.cpp
index 2c27f96..23161ac 100644
--- a/src/tests/kits/interface/bdeskbar/DeskbarGetItemTest.cpp
+++ b/src/tests/kits/interface/bdeskbar/DeskbarGetItemTest.cpp
@@ -14,6 +14,8 @@
 #include "DeskbarGetItemTest.h"
 #include <Deskbar.h>
 
+#include <assert.h>
+
 
 /*
  *  Method:  DeskbarGetItemTest::DeskbarGetItemTest()
diff --git a/src/tests/kits/interface/bdeskbar/DeskbarLocationTest.cpp 
b/src/tests/kits/interface/bdeskbar/DeskbarLocationTest.cpp
index f0b74eb..47718a4 100644
--- a/src/tests/kits/interface/bdeskbar/DeskbarLocationTest.cpp
+++ b/src/tests/kits/interface/bdeskbar/DeskbarLocationTest.cpp
@@ -15,6 +15,8 @@
 #include <Deskbar.h>
 #include <InterfaceDefs.h>
 
+#include <assert.h>
+
 
 /*
  *  Method:  DeskbarLocationTest::DeskbarLocationTest()
diff --git a/src/tests/kits/interface/bpolygon/CreatePolygonTest.cpp 
b/src/tests/kits/interface/bpolygon/CreatePolygonTest.cpp
index 874f625..6cc13ed 100644
--- a/src/tests/kits/interface/bpolygon/CreatePolygonTest.cpp
+++ b/src/tests/kits/interface/bpolygon/CreatePolygonTest.cpp
@@ -22,6 +22,8 @@
 #include <Rect.h>
 #include <Polygon.h>
 
+#include <assert.h>
+
 
 /*
  *  Method:  CreatePolygonTest::CreatePolygonTest()
diff --git a/src/tests/kits/interface/bpolygon/MapPolygonTest.cpp 
b/src/tests/kits/interface/bpolygon/MapPolygonTest.cpp
index 67db355..282483b 100644
--- a/src/tests/kits/interface/bpolygon/MapPolygonTest.cpp
+++ b/src/tests/kits/interface/bpolygon/MapPolygonTest.cpp
@@ -15,6 +15,8 @@
 #include <Rect.h>
 #include <Polygon.h>
 
+#include <assert.h>
+
 
 /*
  *  Method:  MapPolygonTest::MapPolygonTest()
diff --git a/src/tests/kits/interface/bregion/RegionConstruction.cpp 
b/src/tests/kits/interface/bregion/RegionConstruction.cpp
index 3f742da..ab0fb94 100644
--- a/src/tests/kits/interface/bregion/RegionConstruction.cpp
+++ b/src/tests/kits/interface/bregion/RegionConstruction.cpp
@@ -11,6 +11,8 @@
 #include <Region.h>
 #include <Rect.h>
 
+#include <assert.h>
+
 
 /*
  *  Method:  RegionConstruction::RegionConstruction()
diff --git a/src/tests/kits/interface/bregion/RegionExclude.cpp 
b/src/tests/kits/interface/bregion/RegionExclude.cpp
index 2207561..d14e79b 100644
--- a/src/tests/kits/interface/bregion/RegionExclude.cpp
+++ b/src/tests/kits/interface/bregion/RegionExclude.cpp
@@ -11,6 +11,8 @@
 #include <Region.h>
 #include <Rect.h>
 
+#include <assert.h>
+
 
 /*
  *  Method:  RegionExclude::RegionExclude()
diff --git a/src/tests/kits/interface/bregion/RegionInclude.cpp 
b/src/tests/kits/interface/bregion/RegionInclude.cpp
index e82eeb0..2bf3eff 100644
--- a/src/tests/kits/interface/bregion/RegionInclude.cpp
+++ b/src/tests/kits/interface/bregion/RegionInclude.cpp
@@ -11,6 +11,8 @@
 #include <Region.h>
 #include <Rect.h>
 
+#include <assert.h>
+
 
 /*
  *  Method:  RegionInclude::RegionInclude()
diff --git a/src/tests/kits/interface/bregion/RegionIntersect.cpp 
b/src/tests/kits/interface/bregion/RegionIntersect.cpp
index a820111..f4c6623 100644
--- a/src/tests/kits/interface/bregion/RegionIntersect.cpp
+++ b/src/tests/kits/interface/bregion/RegionIntersect.cpp
@@ -11,6 +11,8 @@
 #include <Region.h>
 #include <Rect.h>
 
+#include <assert.h>
+
 
 /*
  *  Method:  RegionIntersect::RegionIntersect()
diff --git a/src/tests/kits/interface/bregion/RegionOffsetBy.cpp 
b/src/tests/kits/interface/bregion/RegionOffsetBy.cpp
index 2c06792..66910a1 100644
--- a/src/tests/kits/interface/bregion/RegionOffsetBy.cpp
+++ b/src/tests/kits/interface/bregion/RegionOffsetBy.cpp
@@ -11,6 +11,8 @@
 #include <Region.h>
 #include <Rect.h>
 
+#include <assert.h>
+
 
 /*
  *  Method:  RegionOffsetBy::RegionOffsetBy()
diff --git a/src/tests/kits/interface/bregion/RegionTestcase.cpp 
b/src/tests/kits/interface/bregion/RegionTestcase.cpp
index fe86924..10ad624 100644
--- a/src/tests/kits/interface/bregion/RegionTestcase.cpp
+++ b/src/tests/kits/interface/bregion/RegionTestcase.cpp
@@ -10,6 +10,8 @@
 #include "RegionTestcase.h"
 #include <Region.h>
 #include <Rect.h>
+
+#include <assert.h>
 #include <math.h>
 
 
diff --git a/src/tests/kits/storage/BasicTest.cpp 
b/src/tests/kits/storage/BasicTest.cpp
index 95adf56..d52d4bd 100644
--- a/src/tests/kits/storage/BasicTest.cpp
+++ b/src/tests/kits/storage/BasicTest.cpp
@@ -1,13 +1,15 @@
 // BasicTest.cpp
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <unistd.h>
-#include <string>
+
+#include <set>
+using std::set;
 
 #include "BasicTest.h"
 
 // count_available_fds
-#include <set>
 static
 int32
 count_available_fds()
diff --git a/src/tests/kits/storage/BasicTest.h 
b/src/tests/kits/storage/BasicTest.h
index 36758c0..01fb3c0 100644
--- a/src/tests/kits/storage/BasicTest.h
+++ b/src/tests/kits/storage/BasicTest.h
@@ -6,9 +6,14 @@
 #include <SupportDefs.h>
 #include <TestCase.h>
 #include <TestShell.h>
-#include <set>
 #include <stdio.h>
 
+#include <set>
+using std::set;
+#include <string>
+using std::string;
+
+
 class BasicTest : public BTestCase
 {
 public:
diff --git a/src/tests/kits/storage/DirectoryTest.cpp 
b/src/tests/kits/storage/DirectoryTest.cpp
index 19fe6bc..3ba0592 100644
--- a/src/tests/kits/storage/DirectoryTest.cpp
+++ b/src/tests/kits/storage/DirectoryTest.cpp
@@ -1,10 +1,13 @@
 // DirectoryTest.cpp
 
 #include <stdio.h>
-#include <string>
+#include <string.h>
 #include <unistd.h>
 #include <sys/stat.h>
 
+#include <string>
+using std::string;
+
 #include <Directory.h>
 #include <Entry.h>
 #include <File.h>
diff --git a/src/tests/kits/storage/EntryTest.cpp 
b/src/tests/kits/storage/EntryTest.cpp
index d4f2e53..0e0220f 100644
--- a/src/tests/kits/storage/EntryTest.cpp
+++ b/src/tests/kits/storage/EntryTest.cpp
@@ -1,11 +1,16 @@
 // EntryTest.cpp
 
 #include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
 #include <list>
+using std::list;
 #include <map>
+using std::map;
 #include <set>
-#include <stdio.h>
-#include <unistd.h>
+using std::set;
 
 #include <cppunit/TestCaller.h>
 #include <cppunit/TestSuite.h>
diff --git a/src/tests/kits/storage/FindDirectoryTest.cpp 
b/src/tests/kits/storage/FindDirectoryTest.cpp
index 7952c94..63c7579 100644
--- a/src/tests/kits/storage/FindDirectoryTest.cpp
+++ b/src/tests/kits/storage/FindDirectoryTest.cpp
@@ -2,9 +2,12 @@
 
 #include <errno.h>
 #include <stdio.h>
-#include <string>
+#include <string.h>
 #include <unistd.h>
 
+#include <string>
+using std::string;
+
 #include "FindDirectoryTest.h"
 
 #include <FindDirectory.h>
diff --git a/src/tests/kits/storage/MimeSnifferTest.cpp 
b/src/tests/kits/storage/MimeSnifferTest.cpp
index e001579..68ee26f 100644
--- a/src/tests/kits/storage/MimeSnifferTest.cpp
+++ b/src/tests/kits/storage/MimeSnifferTest.cpp
@@ -13,7 +13,10 @@
 #include <TestUtils.h>
 
 #include <stdio.h>
-#include <string>
+
+#include <iostream>
+using std::cout;
+using std::endl;
 
 using namespace BPrivate::Storage::Sniffer;
 
@@ -736,10 +739,10 @@ MimeSnifferTest::ScannerTest() {
        };
        
 // Undefine our nasty macros
-#undef T(type)
-#undef S(str)
-#undef I(val)
-#undef F(val)
+#undef T
+#undef S
+#undef I
+#undef F
 
        const int testCaseCount = sizeof(testCases) / sizeof(test_case);
        for (int i = 0; i < testCaseCount; i++) {
diff --git a/src/tests/kits/storage/NodeInfoTest.cpp 
b/src/tests/kits/storage/NodeInfoTest.cpp
index 1aab249..de118b5 100644
--- a/src/tests/kits/storage/NodeInfoTest.cpp
+++ b/src/tests/kits/storage/NodeInfoTest.cpp
@@ -1,9 +1,12 @@
 // NodeInfoTest.cpp
 
 #include <stdio.h>
-#include <string>
+#include <string.h>
 #include <unistd.h>
 
+#include <string>
+using std::string;
+
 #include <Application.h>
 #include <Bitmap.h>
 #include <Directory.h>
diff --git a/src/tests/kits/storage/PathTest.cpp 
b/src/tests/kits/storage/PathTest.cpp
index f51572a..d3952cb 100644
--- a/src/tests/kits/storage/PathTest.cpp
+++ b/src/tests/kits/storage/PathTest.cpp
@@ -9,9 +9,13 @@
 #include <Path.h>
 #include <TypeConstants.h>
 #include <stdio.h>
-#include <string>
+#include <string.h>
 #include <unistd.h>
 
+#include <string>
+using std::string;
+
+
 // Suite
 CppUnit::Test*
 PathTest::Suite() {
diff --git a/src/tests/kits/storage/QueryTest.cpp 
b/src/tests/kits/storage/QueryTest.cpp
index 896149e..b645b09 100644
--- a/src/tests/kits/storage/QueryTest.cpp
+++ b/src/tests/kits/storage/QueryTest.cpp
@@ -95,6 +95,7 @@ public:
 };
 
 // float specialization
+template<>
 BString
 ValueNode<float>::toString() const
 {
@@ -104,6 +105,7 @@ ValueNode<float>::toString() const
 }
 
 // double specialization
+template<>
 BString
 ValueNode<double>::toString() const
 {
diff --git a/src/tests/kits/storage/ResourcesTest.cpp 
b/src/tests/kits/storage/ResourcesTest.cpp
index 17ef3a3..f7e33c7 100644
--- a/src/tests/kits/storage/ResourcesTest.cpp
+++ b/src/tests/kits/storage/ResourcesTest.cpp
@@ -1,9 +1,13 @@
 // ResourcesTest.cpp
 
 #include <stdio.h>
-#include <string>
+#include <stdlib.h>
 #include <unistd.h>
+
+#include <string>
+using std::string;
 #include <vector>
+using std::vector;
 
 #include <ByteOrder.h>
 #include <File.h>
diff --git a/src/tests/kits/storage/StatableTest.h 
b/src/tests/kits/storage/StatableTest.h
index faa02a9..0eaca73 100644
--- a/src/tests/kits/storage/StatableTest.h
+++ b/src/tests/kits/storage/StatableTest.h
@@ -7,7 +7,7 @@
 #include <cppunit/TestSuite.h>
 
 #include <list>
-#include <string>
+using std::list;
 
 #include "BasicTest.h"
 
@@ -27,7 +27,7 @@ struct TestEntries
 
        void delete_all()
        {
-               for (list<C*>::iterator it = entries.begin();
+               for (typename list<C*>::iterator it = entries.begin();
                         it != entries.end();
                         it++) {
                        // Arghh, BStatable has no virtual destructor!
@@ -74,10 +74,10 @@ struct TestEntries
                entryNameIt = entryNames.begin();
        }
 
-       list<C*>                                        entries;
-       list<string>                            entryNames;
-       list<C*>::iterator                      entryIt;
-       list<string>::iterator          entryNameIt;
+       list<C*>                                                entries;
+       list<string>                                    entryNames;
+       typename list<C*>::iterator             entryIt;
+       typename list<string>::iterator entryNameIt;
 };
 
 typedef TestEntries<BStatable> TestStatables;
diff --git a/src/tests/kits/storage/SymLinkTest.cpp 
b/src/tests/kits/storage/SymLinkTest.cpp
index 8b1db5f..782944c 100644
--- a/src/tests/kits/storage/SymLinkTest.cpp
+++ b/src/tests/kits/storage/SymLinkTest.cpp
@@ -1,7 +1,10 @@
 // SymLinkTest.cpp
 
 #include <stdio.h>
+#include <string.h>
+
 #include <string>
+using std::string;
 
 #include <Directory.h>
 #include <Entry.h>
diff --git a/src/tests/kits/storage/TestApp.cpp 
b/src/tests/kits/storage/TestApp.cpp
index 90d2ba6..9909bf3 100644
--- a/src/tests/kits/storage/TestApp.cpp
+++ b/src/tests/kits/storage/TestApp.cpp
@@ -1,6 +1,7 @@
 // TestApp.cpp
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include <Autolock.h>
diff --git a/src/tests/kits/translation/BitmapStreamTest.cpp 
b/src/tests/kits/translation/BitmapStreamTest.cpp
index 9a00ce4..a72eb8a 100644
--- a/src/tests/kits/translation/BitmapStreamTest.cpp
+++ b/src/tests/kits/translation/BitmapStreamTest.cpp
@@ -31,11 +31,14 @@
 // DEALINGS IN THE SOFTWARE.
 /*****************************************************************************/
 #include "BitmapStreamTest.h"
-#include <stdio.h>
+
 #include <TranslatorRoster.h>
 #include <Application.h>
 #include <Bitmap.h>
 
+#include <stdio.h>
+#include <string.h>
+
 /* cppunit framework */
 #include <cppunit/Test.h>
 #include <cppunit/TestCaller.h>
diff --git a/src/tests/kits/translation/TranslationUtilsTest.cpp 
b/src/tests/kits/translation/TranslationUtilsTest.cpp
index 4eff435..80c7c40 100644
--- a/src/tests/kits/translation/TranslationUtilsTest.cpp
+++ b/src/tests/kits/translation/TranslationUtilsTest.cpp
@@ -31,7 +31,6 @@
 // DEALINGS IN THE SOFTWARE.
 /*****************************************************************************/
 #include "TranslationUtilsTest.h"
-#include <stdio.h>
 #include <TranslatorFormats.h>
        // for B_TRANSLATOR_EXT_*
 #include <TranslatorRoster.h>
@@ -44,6 +43,9 @@
 #include <Entry.h>
 #include <OS.h>
 
+#include <stdio.h>
+#include <string.h>
+
 /* cppunit framework */
 #include <cppunit/Test.h>
 #include <cppunit/TestCaller.h>
diff --git a/src/tests/kits/translation/TranslatorRosterTest.cpp 
b/src/tests/kits/translation/TranslatorRosterTest.cpp
index adf57c6..6b61db5 100644
--- a/src/tests/kits/translation/TranslatorRosterTest.cpp
+++ b/src/tests/kits/translation/TranslatorRosterTest.cpp
@@ -33,6 +33,7 @@
 #include "TranslatorRosterTest.h"
 
 #include <stdio.h>
+#include <string.h>
 
 #include <Application.h>
 #include <Archivable.h>
diff --git a/src/tests/system/kernel/util/DoublyLinkedListTest.cpp 
b/src/tests/system/kernel/util/DoublyLinkedListTest.cpp
index 5d6489f..90e93bf 100644
--- a/src/tests/system/kernel/util/DoublyLinkedListTest.cpp
+++ b/src/tests/system/kernel/util/DoublyLinkedListTest.cpp
@@ -106,7 +106,8 @@ DoublyLinkedListTest::TestList()
        // count items in list
 
        int count = 0;
-       DoublyLinkedList<Item, DoublyLinkedListMemberGetLink<Item> >::Iterator
+       typename DoublyLinkedList<Item,
+                       DoublyLinkedListMemberGetLink<Item> >::Iterator
                iterator = list.GetIterator();
        while (iterator.Next() != NULL)
                count++;
diff --git a/src/tests/system/kernel/util/OrderedMapTest.h 
b/src/tests/system/kernel/util/OrderedMapTest.h
index dbdbba6..4eb49c9 100644
--- a/src/tests/system/kernel/util/OrderedMapTest.h
+++ b/src/tests/system/kernel/util/OrderedMapTest.h
@@ -6,6 +6,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+using std::map;
+
 #include <TestCase.h>
 #include <TestUtils.h>
 #include <cppunit/Test.h>
@@ -601,7 +603,7 @@ public:
        typedef typename KeyStrategy::Value                                     
                Key;
        typedef typename ValueStrategy::Value                                   
        Value;
 //     typedef _CompareStrategy<Key>                                           
                Compare;
-       typedef typename CompareStrategyWrapper::Strategy<Key>          Compare;
+       typedef typename CompareStrategyWrapper::template Strategy<Key>         
Compare;
        typedef CompareWrapper<Key, Compare>                                    
        BoolCompare;
        typedef _MyMap<Compare>                                                 
                        MyMap;
        typedef map<Key, Value, BoolCompare>                                    
        ReferenceMap;
@@ -664,8 +666,6 @@ void
 GenericInsertTest(int32 maxNumber)
 {
        typedef typename _TestStrategy::EntryStrategy   EntryStrategy;
-       typedef typename _TestStrategy::KeyStrategy             KeyStrategy;
-       typedef typename _TestStrategy::ValueStrategy   ValueStrategy;
        typedef typename _TestStrategy::Key                             Key;
        typedef typename _TestStrategy::Value                   Value;
        typedef typename _TestStrategy::TestClass               TestClass;
@@ -707,8 +707,6 @@ void
 GenericPutTest(int32 maxNumber)
 {
        typedef typename _TestStrategy::EntryStrategy   EntryStrategy;
-       typedef typename _TestStrategy::KeyStrategy             KeyStrategy;
-       typedef typename _TestStrategy::ValueStrategy   ValueStrategy;
        typedef typename _TestStrategy::Key                             Key;
        typedef typename _TestStrategy::Value                   Value;
        typedef typename _TestStrategy::TestClass               TestClass;
@@ -750,13 +748,10 @@ void
 GenericGetTest(int32 maxNumber)
 {
        typedef typename _TestStrategy::EntryStrategy   EntryStrategy;
-       typedef typename _TestStrategy::KeyStrategy             KeyStrategy;
-       typedef typename _TestStrategy::ValueStrategy   ValueStrategy;
        typedef typename _TestStrategy::Key                             Key;
        typedef typename _TestStrategy::Value                   Value;
        typedef typename _TestStrategy::TestClass               TestClass;
        typedef typename TestClass::Iterator                    Iterator;
-       typedef typename TestClass::ConstIterator               ConstIterator;
        EntryStrategy entryStrategy;
        TestClass v;
        GenericFill(v, entryStrategy, maxNumber);
@@ -818,10 +813,7 @@ void
 GenericRemoveTest(int32 maxNumber)
 {
        typedef typename _TestStrategy::EntryStrategy   EntryStrategy;
-       typedef typename _TestStrategy::KeyStrategy             KeyStrategy;
-       typedef typename _TestStrategy::ValueStrategy   ValueStrategy;
        typedef typename _TestStrategy::Key                             Key;
-       typedef typename _TestStrategy::Value                   Value;
        typedef typename _TestStrategy::TestClass               TestClass;
        EntryStrategy entryStrategy;
        TestClass v;
@@ -862,10 +854,6 @@ void
 GenericEraseTest(int32 maxNumber)
 {
        typedef typename _TestStrategy::EntryStrategy   EntryStrategy;
-       typedef typename _TestStrategy::KeyStrategy             KeyStrategy;
-       typedef typename _TestStrategy::ValueStrategy   ValueStrategy;
-       typedef typename _TestStrategy::Key                             Key;
-       typedef typename _TestStrategy::Value                   Value;
        typedef typename _TestStrategy::TestClass               TestClass;
        EntryStrategy entryStrategy;
        TestClass v;
@@ -904,10 +892,6 @@ void
 GenericMakeEmptyTest(int32 maxNumber)
 {
        typedef typename _TestStrategy::EntryStrategy   EntryStrategy;
-       typedef typename _TestStrategy::KeyStrategy             KeyStrategy;
-       typedef typename _TestStrategy::ValueStrategy   ValueStrategy;
-       typedef typename _TestStrategy::Key                             Key;
-       typedef typename _TestStrategy::Value                   Value;
        typedef typename _TestStrategy::TestClass               TestClass;
        EntryStrategy entryStrategy;
        TestClass v;
@@ -945,10 +929,7 @@ void
 GenericFindTest(int32 maxNumber)
 {
        typedef typename _TestStrategy::EntryStrategy   EntryStrategy;
-       typedef typename _TestStrategy::KeyStrategy             KeyStrategy;
-       typedef typename _TestStrategy::ValueStrategy   ValueStrategy;
        typedef typename _TestStrategy::Key                             Key;
-       typedef typename _TestStrategy::Value                   Value;
        typedef typename _TestStrategy::TestClass               TestClass;
        typedef typename TestClass::Iterator                    Iterator;
        typedef typename TestClass::ConstIterator               ConstIterator;
@@ -1010,10 +991,7 @@ void
 GenericFindCloseTest(int32 maxNumber)
 {
        typedef typename _TestStrategy::EntryStrategy   EntryStrategy;
-       typedef typename _TestStrategy::KeyStrategy             KeyStrategy;
-       typedef typename _TestStrategy::ValueStrategy   ValueStrategy;
        typedef typename _TestStrategy::Key                             Key;
-       typedef typename _TestStrategy::Value                   Value;
        typedef typename _TestStrategy::TestClass               TestClass;
        typedef typename TestClass::Iterator                    Iterator;
        typedef typename TestClass::ConstIterator               ConstIterator;
@@ -1093,10 +1071,6 @@ void
 GenericIteratorTest(int32 maxNumber)
 {
        typedef typename _TestStrategy::EntryStrategy   EntryStrategy;
-       typedef typename _TestStrategy::KeyStrategy             KeyStrategy;
-       typedef typename _TestStrategy::ValueStrategy   ValueStrategy;
-       typedef typename _TestStrategy::Key                             Key;
-       typedef typename _TestStrategy::Value                   Value;
        typedef typename _TestStrategy::TestClass               TestClass;
        typedef typename TestClass::Iterator                    Iterator;
        typedef typename TestClass::ConstIterator               ConstIterator;
diff --git a/src/tests/system/kernel/util/VectorMapTest.cpp 
b/src/tests/system/kernel/util/VectorMapTest.cpp
index c7551e4..1546030 100644
--- a/src/tests/system/kernel/util/VectorMapTest.cpp
+++ b/src/tests/system/kernel/util/VectorMapTest.cpp
@@ -83,7 +83,7 @@ string_hash(const char *name)
 {
        uint32 h = 0;
        for (; *name; name++) {
-               if (uint32 g = g & 0xf0000000)
+               if (uint32 g = h & 0xf0000000)
                        h ^= g >> 24;
                h = (h << 4) + *name;
        }
diff --git a/src/tests/system/kernel/util/VectorSetTest.cpp 
b/src/tests/system/kernel/util/VectorSetTest.cpp
index 4fdfcc9..74d1d13 100644
--- a/src/tests/system/kernel/util/VectorSetTest.cpp
+++ b/src/tests/system/kernel/util/VectorSetTest.cpp
@@ -3,6 +3,7 @@
 #include <stdlib.h>
 
 #include <set>
+using std::set;
 
 #include <TestUtils.h>
 #include <cppunit/Test.h>
@@ -518,7 +519,6 @@ void
 GenericInsertTest(int32 maxNumber)
 {
        typedef typename _TestStrategy::ValueStrategy   ValueStrategy;
-       typedef typename _TestStrategy::Value                   Value;
        typedef typename _TestStrategy::TestClass               TestClass;
        ValueStrategy strategy;
        TestClass v;
@@ -610,7 +610,6 @@ void
 GenericEraseTest(int32 maxNumber)
 {
        typedef typename _TestStrategy::ValueStrategy   ValueStrategy;
-       typedef typename _TestStrategy::Value                   Value;
        typedef typename _TestStrategy::TestClass               TestClass;
        ValueStrategy strategy;
        TestClass v;
@@ -650,7 +649,6 @@ void
 GenericMakeEmptyTest(int32 maxNumber)
 {
        typedef typename _TestStrategy::ValueStrategy   ValueStrategy;
-       typedef typename _TestStrategy::Value                   Value;
        typedef typename _TestStrategy::TestClass               TestClass;
        ValueStrategy strategy;
        TestClass v;
@@ -810,7 +808,6 @@ void
 GenericIteratorTest(int32 maxNumber)
 {
        typedef typename _TestStrategy::ValueStrategy   ValueStrategy;
-       typedef typename _TestStrategy::Value                   Value;
        typedef typename _TestStrategy::TestClass               TestClass;
        typedef typename TestClass::Iterator                    Iterator;
        typedef typename TestClass::ConstIterator               ConstIterator;
diff --git a/src/tests/system/kernel/util/VectorTest.cpp 
b/src/tests/system/kernel/util/VectorTest.cpp
index 3d77972..ddc07e0 100644
--- a/src/tests/system/kernel/util/VectorTest.cpp
+++ b/src/tests/system/kernel/util/VectorTest.cpp
@@ -190,10 +190,10 @@ public:
 template<typename Value>
 class TestVector {
 public:
-       typedef Vector<Value>::Iterator                                 
MyIterator;
-       typedef vector<Value>::iterator                                 
ReferenceIterator;
-       typedef Vector<Value>::ConstIterator                    MyConstIterator;
-       typedef vector<Value>::const_iterator                   
ReferenceConstIterator;
+       typedef typename Vector<Value>::Iterator                MyIterator;
+       typedef typename vector<Value>::iterator                
ReferenceIterator;
+       typedef typename Vector<Value>::ConstIterator   MyConstIterator;
+       typedef typename vector<Value>::const_iterator  ReferenceConstIterator;
        typedef TestIterator<Value, TestVector<Value>, MyIterator,
                                                 ReferenceIterator>             
        Iterator;
        typedef TestIterator<const Value, const TestVector<Value>, 
MyConstIterator,
@@ -238,7 +238,7 @@ public:
        {
                if (index >= 0 && index <= Count()) {
                        CHK(fMyVector.Insert(value, index) == B_OK);
-                       vector<Value>::iterator it = fReferenceVector.begin();
+                       typename vector<Value>::iterator it = 
fReferenceVector.begin();
                        for (int32 i = 0; i < index; i++)
                                ++it;
                        fReferenceVector.insert(it, value);
@@ -873,9 +873,10 @@ GenericFindTest(ValueStrategy strategy, int32 maxNumber)
        // find the values in the vector
        const TestVector<Value> &cv = v;
        for (int32 i = 0; i < maxNumber; i++) {
-               TestVector<Value>::ConstIterator cit = cv.Begin();
+               typename TestVector<Value>::ConstIterator cit = cv.Begin();
                int32 index = 0;
-               for (TestVector<Value>::Iterator it = v.Begin(); it != v.End(); 
) {
+               for (typename TestVector<Value>::Iterator it = v.Begin();
+                               it != v.End(); ) {
                        CHK(&v[index] == &*it);
                        CHK(&cv[index] == &*cit);
                        CHK(*it == *cit);
@@ -887,8 +888,8 @@ GenericFindTest(ValueStrategy strategy, int32 maxNumber)
        // try to find some random values
        for (int32 i = 0; i < maxNumber; i++) {
                Value value = strategy.Generate();
-               TestVector<Value>::Iterator it = v.Find(value);
-               TestVector<Value>::ConstIterator cit = cv.Find(value);
+               typename TestVector<Value>::Iterator it = v.Find(value);
+               typename TestVector<Value>::ConstIterator cit = cv.Find(value);
                if (it != v.End())
                        CHK(&*it == &*cit);
        }
@@ -926,8 +927,8 @@ GenericIteratorTest(ValueStrategy strategy, int32 maxNumber)
        TestVector<Value> v;
        GenericFill(v, strategy, maxNumber);
        const TestVector<Value> &cv = v;
-       TestVector<Value>::Iterator it = v.Begin();
-       TestVector<Value>::ConstIterator cit = cv.Begin();
+       typename TestVector<Value>::Iterator it = v.Begin();
+       typename TestVector<Value>::ConstIterator cit = cv.Begin();
        for (; it != v.End(); ++it, ++cit) {
                CHK(&*it == &*cit);
                CHK(&*it == it.operator->());


Other related posts:

  • » [haiku-commits] haiku: hrev47347 - in src: tests/system/kernel/util tests/kits/storage tests/kits/interface tests/add-ons/translators/stxttranslator bin/makeudfimage - zooey