const correctness
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
diff --git a/include/FTLibrary.h b/include/FTLibrary.h
index 1e5ed6b..e4f53f5 100755
--- a/include/FTLibrary.h
+++ b/include/FTLibrary.h
@@ -34,7 +34,7 @@ class FTGL_EXPORT FTLibrary
*
* @return The global <code>FTLibrary</code> object.
*/
- static FTLibrary& Instance();
+ static const FTLibrary& Instance();
/**
* Gets a pointer to the native Freetype library.
diff --git a/test/FTLibrary-Test.cpp b/test/FTLibrary-Test.cpp
index d614637..28a978c 100755
--- a/test/FTLibrary-Test.cpp
+++ b/test/FTLibrary-Test.cpp
@@ -20,8 +20,8 @@ class FTLibraryTest : public CppUnit::TestCase
void testConstructor()
{
- FTLibrary& libraryOne = FTLibrary::Instance();
- FTLibrary& libraryTwo = FTLibrary::Instance();
+ const FTLibrary& libraryOne = FTLibrary::Instance();
+ const FTLibrary& libraryTwo = FTLibrary::Instance();
CPPUNIT_ASSERT( &libraryOne == &libraryTwo);
CPPUNIT_ASSERT( &libraryOne == &FTLibrary::Instance());
@@ -30,7 +30,7 @@ class FTLibraryTest : public CppUnit::TestCase
void testError()
{
- FTLibrary& library = FTLibrary::Instance();
+ const FTLibrary& library = FTLibrary::Instance();
CPPUNIT_ASSERT( library.Error() == 0);
}