gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash/testsuite libamf.all/test_buffer.cpp libn...


From: Rob Savoye
Subject: [Gnash-commit] gnash/testsuite libamf.all/test_buffer.cpp libn...
Date: Tue, 01 Apr 2008 22:18:48 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Rob Savoye <rsavoye>    08/04/01 22:18:48

Added files:
        testsuite/libamf.all: test_buffer.cpp 
Removed files:
        testsuite/libnet.all: test_buffer.cpp 

Log message:
        test_buffer move frpom libnet.all to libamf.all.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/libamf.all/test_buffer.cpp?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/libnet.all/test_buffer.cpp?cvsroot=gnash&r1=1.1&r2=0

Patches:
Index: libamf.all/test_buffer.cpp
===================================================================
RCS file: libamf.all/test_buffer.cpp
diff -N libamf.all/test_buffer.cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libamf.all/test_buffer.cpp  1 Apr 2008 22:18:46 -0000       1.1
@@ -0,0 +1,112 @@
+// 
+//   Copyright (C) 2008 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 3 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 "gnashconfig.h"
+#endif
+
+#include <regex.h>
+#include <cstdio>
+#include <cerrno>
+#include <iostream>
+#include <fstream>
+#include <cstring>
+#include <vector>
+#include <boost/cstdint.hpp>
+
+#ifdef HAVE_DEJAGNU_H
+#include "dejagnu.h"
+#else
+#include "check.h"
+#endif
+
+#include "log.h"
+#include "network.h"
+#include "gmemory.h"
+#include "buffer.h"
+
+using namespace std;
+using namespace amf;
+using namespace gnash;
+using namespace boost;
+
+TestState runtest;
+LogFile& dbglogfile = LogFile::getDefaultInstance();
+
+int
+main (int /*argc*/, char** /*argv*/) {
+    gnash::LogFile& dbglogfile = gnash::LogFile::getDefaultInstance();
+    dbglogfile.setVerbosity();
+    // We use the Memory profiling class to check the malloc buffers
+    // in the kernel to make sure the allocations and frees happen
+    // the way we expect them too. There is no real other way to tell.
+    Memory mem;
+    mem.startStats();
+
+    Buffer buf;
+    mem.addStats(__LINE__);             // take a sample
+    
+    if (buf.size() == gnash::NETBUFSIZE) {
+         runtest.pass ("Buffer::size()");
+     } else {
+         runtest.fail ("Buffer::size()");
+    }
+
+    mem.addStats(__LINE__);             // take a sample
+    buf.resize(112);
+    mem.addStats(__LINE__);             // take a sample
+
+    if (buf.size() == 112) {
+         runtest.pass ("Buffer::resize()");
+     } else {
+         runtest.fail ("Buffer::resize()");
+    }
+    mem.addStats(__LINE__);             // take a sample
+
+//    buf.dump();    
+    mem.addStats(__LINE__);             // take a sample
+    buf.empty();                        //empty just nukes the contents
+    if ((buf.size() == 112) && (mem.diffStats() == 0)) {
+         runtest.pass ("Buffer::empty()");
+     } else {
+         runtest.fail ("Buffer::empty()");
+    }
+
+    // populate the buffer
+    boost::uint8_t *ptr = buf.reference();
+    for (size_t i=1; i< buf.size(); i++) {
+        ptr[i] = i;
+    }
+
+    Buffer buf2;
+    if (buf2 == buf) {
+         runtest.fail ("Buffer::operator==");
+     } else {
+         runtest.pass ("Buffer::operator==");
+    }
+
+    buf2 = buf;
+    if (buf2 == buf) {
+         runtest.pass ("Buffer::operator=");
+     } else {
+         runtest.fail ("Buffer::operator=");
+    }
+
+//    mem.analyze();
+}
+

Index: libnet.all/test_buffer.cpp
===================================================================
RCS file: libnet.all/test_buffer.cpp
diff -N libnet.all/test_buffer.cpp
--- libnet.all/test_buffer.cpp  28 Mar 2008 21:30:27 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,111 +0,0 @@
-// 
-//   Copyright (C) 2008 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 3 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 "gnashconfig.h"
-#endif
-
-#include <regex.h>
-#include <cstdio>
-#include <cerrno>
-#include <iostream>
-#include <fstream>
-#include <cstring>
-#include <vector>
-#include <boost/cstdint.hpp>
-
-#ifdef HAVE_DEJAGNU_H
-#include "dejagnu.h"
-#else
-#include "check.h"
-#endif
-
-#include "log.h"
-#include "network.h"
-#include "gmemory.h"
-#include "buffer.h"
-
-using namespace std;
-using namespace gnash;
-using namespace boost;
-
-TestState runtest;
-LogFile& dbglogfile = LogFile::getDefaultInstance();
-
-int
-main (int /*argc*/, char** /*argv*/) {
-    gnash::LogFile& dbglogfile = gnash::LogFile::getDefaultInstance();
-    dbglogfile.setVerbosity();
-    // We use the Memory profiling class to check the malloc buffers
-    // in the kernel to make sure the allocations and frees happen
-    // the way we expect them too. There is no real other way to tell.
-    Memory mem;
-    mem.startStats();
-
-    Buffer buf;
-    mem.addStats(__LINE__);             // take a sample
-    
-    if (buf.size() == gnash::NETBUFSIZE) {
-         runtest.pass ("Buffer::size()");
-     } else {
-         runtest.fail ("Buffer::size()");
-    }
-
-    mem.addStats(__LINE__);             // take a sample
-    buf.resize(112);
-    mem.addStats(__LINE__);             // take a sample
-
-    if ((buf.size() == 112)  && (mem.diffStats() == -16)) {
-         runtest.pass ("Buffer::resize()");
-     } else {
-         runtest.fail ("Buffer::resize()");
-    }
-    mem.addStats(__LINE__);             // take a sample
-
-//    buf.dump();    
-    mem.addStats(__LINE__);             // take a sample
-    buf.empty();                        //empty just nukes the contents
-    if ((buf.size() == 112) && (mem.diffStats() == 0)) {
-         runtest.pass ("Buffer::empty()");
-     } else {
-         runtest.fail ("Buffer::empty()");
-    }
-
-    // populate the buffer
-    boost::uint8_t *ptr = buf.reference();
-    for (size_t i=1; i< buf.size(); i++) {
-        ptr[i] = i;
-    }
-
-    Buffer buf2;
-    if (buf2 == buf) {
-         runtest.fail ("Buffer::operator==");
-     } else {
-         runtest.pass ("Buffer::operator==");
-    }
-
-    buf2 = buf;
-    if (buf2 == buf) {
-         runtest.pass ("Buffer::operator=");
-     } else {
-         runtest.fail ("Buffer::operator=");
-    }
-
-//    mem.analyze();
-}
-




reply via email to

[Prev in Thread] Current Thread [Next in Thread]