[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog testsuite/libbase/Makefile.am t... [relea
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog testsuite/libbase/Makefile.am t... [release_0_7_2] |
Date: |
Wed, 08 Nov 2006 09:17:26 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Branch: release_0_7_2
Changes by: Sandro Santilli <strk> 06/11/08 09:17:26
Modified files:
. : ChangeLog
testsuite/libbase: Makefile.am
Added files:
testsuite/libbase: smart_ptrTest.cpp
Log message:
* testsuite/libbase/: Makefile.am, smart_ptrTest.cpp:
added unit test for smart_ptr<>.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&only_with_tag=release_0_7_2&r1=1.1412.2.115&r2=1.1412.2.116
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/libbase/Makefile.am?cvsroot=gnash&only_with_tag=release_0_7_2&r1=1.19.2.1&r2=1.19.2.2
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/libbase/smart_ptrTest.cpp?cvsroot=gnash&only_with_tag=release_0_7_2&rev=1.1.2.1
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1412.2.115
retrieving revision 1.1412.2.116
diff -u -b -r1.1412.2.115 -r1.1412.2.116
--- ChangeLog 8 Nov 2006 09:16:33 -0000 1.1412.2.115
+++ ChangeLog 8 Nov 2006 09:17:25 -0000 1.1412.2.116
@@ -1,5 +1,7 @@
2006-11-08 Sandro Santilli <address@hidden>
+ * testsuite/libbase/: Makefile.am, smart_ptrTest.cpp:
+ added unit test for smart_ptr<>.
* configure.ac: move the AC_DEFINE([GUI_*]) calls *after*
the possible fallback to SDL (see bug #15540)
* gui/Player.cpp: don't issue a warning if RENDER_OPENGL is
Index: testsuite/libbase/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/testsuite/libbase/Makefile.am,v
retrieving revision 1.19.2.1
retrieving revision 1.19.2.2
diff -u -b -r1.19.2.1 -r1.19.2.2
--- testsuite/libbase/Makefile.am 30 Oct 2006 14:28:55 -0000 1.19.2.1
+++ testsuite/libbase/Makefile.am 8 Nov 2006 09:17:25 -0000 1.19.2.2
@@ -41,6 +41,7 @@
CurlStreamTest \
NoSeekFileTest \
URLTest \
+ smart_ptrTest \
RcTest
CLEANFILES = \
@@ -65,6 +66,9 @@
URLTest_SOURCES = URLTest.cpp
URLTest_CPPFLAGS = '-DBUILDDIR="$(abs_builddir)"'
+smart_ptrTest_SOURCES = smart_ptrTest.cpp
+smart_ptrTest_CPPFLAGS = '-DBUILDDIR="$(abs_builddir)"'
+
RcTest_SOURCES = TCXXRc.cpp
RcTest_CPPFLAGS = -DSRCDIR="$(srcdir)"
Index: testsuite/libbase/smart_ptrTest.cpp
===================================================================
RCS file: testsuite/libbase/smart_ptrTest.cpp
diff -N testsuite/libbase/smart_ptrTest.cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ testsuite/libbase/smart_ptrTest.cpp 8 Nov 2006 09:17:25 -0000 1.1.2.1
@@ -0,0 +1,71 @@
+//
+// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "check.h"
+#include "smart_ptr.h"
+#include "ref_counted.h"
+
+#include <iostream>
+#include <sstream>
+#include <cassert>
+
+using namespace std;
+using namespace gnash;
+
+int
+main(int /*argc*/, char** /*argv*/)
+{
+ ref_counted* obj = new ref_counted();
+ check_equals(obj->get_ref_count(), 0);
+
+ smart_ptr<ref_counted> ptr1(obj);
+ check_equals(obj->get_ref_count(), 1);
+
+ smart_ptr<ref_counted> ptr2(obj);
+ check_equals(obj->get_ref_count(), 2);
+
+ smart_ptr<ref_counted> ptr3(ptr1);
+ check_equals(obj->get_ref_count(), 3);
+
+ smart_ptr<ref_counted> ptr4(ptr2.get_ptr());
+ check_equals(obj->get_ref_count(), 4);
+
+ ptr1 = ptr3;
+ check_equals(obj->get_ref_count(), 4);
+
+ ptr1 = ptr3.get_ptr();
+ check_equals(obj->get_ref_count(), 4);
+
+ smart_ptr<ref_counted> ptr5;
+ ptr5 = ptr3;
+ check_equals(obj->get_ref_count(), 5);
+
+ {
+ smart_ptr<ref_counted> ptr6(obj);
+ check_equals(obj->get_ref_count(), 6);
+ smart_ptr<ref_counted> ptr7(ptr6);
+ check_equals(obj->get_ref_count(), 7);
+ smart_ptr<ref_counted> ptr8(ptr7);
+ check_equals(obj->get_ref_count(), 8);
+ }
+
+ check_equals(obj->get_ref_count(), 5);
+}
+
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog testsuite/libbase/Makefile.am t... [release_0_7_2],
Sandro Santilli <=