[xiph-commits] r7337 - in trunk/oggdsf:

illiminable at dactyl.lonelymoon.com illiminable
Sun Jul 25 14:42:19 PDT 2004


build/libOOOggWithToolsAndTests sln/libOOOggWithToolsAndTests
src/lib/core/ogg/libOOOgg src/tests src/tests/testCircleBuffer
Message-ID: <20040725214219.9AD5A9AAAB at dactyl.lonelymoon.com>

Author: illiminable
Date: Sun Jul 25 14:42:19 2004
New Revision: 7337

Added:
trunk/oggdsf/src/tests/testCircleBuffer/
trunk/oggdsf/src/tests/testCircleBuffer/ReadMe.txt
trunk/oggdsf/src/tests/testCircleBuffer/stdafx.cpp
trunk/oggdsf/src/tests/testCircleBuffer/stdafx.h
trunk/oggdsf/src/tests/testCircleBuffer/testCircleBuffer.cpp
trunk/oggdsf/src/tests/testCircleBuffer/testCircleBuffer.vcproj
Modified:
trunk/oggdsf/build/libOOOggWithToolsAndTests/libOOOggWithToolsAndTests.vdproj
trunk/oggdsf/sln/libOOOggWithToolsAndTests/libOOOggWithToolsAndTests.sln
trunk/oggdsf/src/lib/core/ogg/libOOOgg/CircularBuffer.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOgg/CircularBuffer.h
Log:
* Add buffer test program

Modified: trunk/oggdsf/build/libOOOggWithToolsAndTests/libOOOggWithToolsAndTests.vdproj
===================================================================
--- trunk/oggdsf/build/libOOOggWithToolsAndTests/libOOOggWithToolsAndTests.vdproj	2004-07-25 20:28:53 UTC (rev 7336)
+++ trunk/oggdsf/build/libOOOggWithToolsAndTests/libOOOggWithToolsAndTests.vdproj	2004-07-25 21:42:17 UTC (rev 7337)
@@ -57,6 +57,12 @@
}
"Entry"
{
+        "MsmKey" = "8:_C0BA320CDA794057812E2CF28F5EA94C"
+        "OwnerKey" = "8:_UNDEFINED"
+        "MsmSig" = "8:_UNDEFINED"
+        }
+        "Entry"
+        {
"MsmKey" = "8:_DCF47080823151CD8BF79A8AE0EA1C5D"
"OwnerKey" = "8:_9061237CE81A4BAC9A988D1713DCE01A"
"MsmSig" = "8:_UNDEFINED"
@@ -239,7 +245,7 @@
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:libOOOggWithToolsAndTests"
"ProductCode" = "8:{E213AA75-8F79-4E6E-A8AE-A131AA8B4058}"
-        "PackageCode" = "8:{F715599B-15C0-4FB2-A8FF-A61AC3488477}"
+        "PackageCode" = "8:{B7230D86-C4A7-4B42-A043-CE625A26690C}"
"UpgradeCode" = "8:{EC58A5EB-BA29-4AA6-B91D-26DFDB021492}"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:FALSE"
@@ -823,6 +829,34 @@
{
}
}
+            "{8062640A-2EEE-46E9-AB67-688E9A886E9F}:_C0BA320CDA794057812E2CF28F5EA94C"
+            {
+            "SourcePath" = "8:..\\..\\src\\tests\\testcirclebuffer\\debug\\testCircleBuffer.exe"
+            "TargetName" = "8:"
+            "Tag" = "8:"
+            "Folder" = "8:_ADE7E20E4D77439FB3A1B61B3F803F3B"
+            "Condition" = "8:"
+            "Transitive" = "11:FALSE"
+            "Vital" = "11:TRUE"
+            "ReadOnly" = "11:FALSE"
+            "Hidden" = "11:FALSE"
+            "System" = "11:FALSE"
+            "Permanent" = "11:FALSE"
+            "SharedLegacy" = "11:FALSE"
+            "PackageAs" = "3:1"
+            "Register" = "3:1"
+            "Exclude" = "11:FALSE"
+            "IsDependency" = "11:FALSE"
+            "IsolateTo" = "8:"
+            "ProjectOutputGroupRegister" = "3:1"
+            "OutputConfiguration" = "8:"
+            "OutputGroupCanonicalName" = "8:Built"
+            "OutputProjectGuid" = "8:{191217F4-1F30-426D-A2AB-A9E613D9A401}"
+            "ShowKeyOutput" = "11:TRUE"
+                "ExcludeFilters"
+                {
+                }
+            }
"{8062640A-2EEE-46E9-AB67-688E9A886E9F}:_DFF78663650B4CF0A485185D63D04FB5"
{
"SourcePath" = "8:..\\..\\src\\tools\\OOOggStat\\Debug\\OOOggStat.exe"

Modified: trunk/oggdsf/sln/libOOOggWithToolsAndTests/libOOOggWithToolsAndTests.sln
===================================================================
--- trunk/oggdsf/sln/libOOOggWithToolsAndTests/libOOOggWithToolsAndTests.sln	2004-07-25 20:28:53 UTC (rev 7336)
+++ trunk/oggdsf/sln/libOOOggWithToolsAndTests/libOOOggWithToolsAndTests.sln	2004-07-25 21:42:17 UTC (rev 7337)
@@ -22,6 +22,11 @@
{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testCircleBuffer", "..\..\src\tests\testCircleBuffer\testCircleBuffer.vcproj", "{191217F4-1F30-426D-A2AB-A9E613D9A401}"
+	ProjectSection(ProjectDependencies) = postProject
+		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
+	EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
@@ -46,6 +51,10 @@
{B5BF942B-4864-414C-9855-65E5CC923401}.Debug.Build.0 = Debug|Win32
{B5BF942B-4864-414C-9855-65E5CC923401}.Release.ActiveCfg = Release|Win32
{B5BF942B-4864-414C-9855-65E5CC923401}.Release.Build.0 = Release|Win32
+		{191217F4-1F30-426D-A2AB-A9E613D9A401}.Debug.ActiveCfg = Debug|Win32
+		{191217F4-1F30-426D-A2AB-A9E613D9A401}.Debug.Build.0 = Debug|Win32
+		{191217F4-1F30-426D-A2AB-A9E613D9A401}.Release.ActiveCfg = Release|Win32
+		{191217F4-1F30-426D-A2AB-A9E613D9A401}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/CircularBuffer.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/CircularBuffer.cpp	2004-07-25 20:28:53 UTC (rev 7336)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/CircularBuffer.cpp	2004-07-25 21:42:17 UTC (rev 7337)
@@ -39,8 +39,8 @@
mReadPtr = (mReadPtr + locBytesToRead) % mBufferSize;
}

-	mReadPtr = (mReadPtr + locBytesToRead) % mBufferSize;

+
return locBytesToRead;
}

@@ -68,6 +68,11 @@
}
}

+void CircularBuffer::reset() {
+	mWritePtr = 0;
+	mReadPtr = 0;
+}
+
unsigned long CircularBuffer::write(const unsigned char* inData, unsigned long inBytesToWrite) {
unsigned long locBytesToWrite =			(inBytesToWrite >  spaceLeft())		?	spaceLeft()
:	inBytesToWrite;

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/CircularBuffer.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/CircularBuffer.h	2004-07-25 20:28:53 UTC (rev 7336)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/CircularBuffer.h	2004-07-25 21:42:17 UTC (rev 7337)
@@ -1,6 +1,6 @@
#pragma once
-
-class CircularBuffer
+#include "dllstuff.h"
+class LIBOOOGG_API CircularBuffer
{
public:
CircularBuffer(unsigned long inBufferSize);
@@ -12,6 +12,7 @@
unsigned long numBytesAvail();
unsigned long spaceLeft();

+	void reset();
protected:
unsigned long mBufferSize;
unsigned long mReadPtr;

Added: trunk/oggdsf/src/tests/testCircleBuffer/ReadMe.txt
===================================================================
--- trunk/oggdsf/src/tests/testCircleBuffer/ReadMe.txt	2004-07-25 20:28:53 UTC (rev 7336)
+++ trunk/oggdsf/src/tests/testCircleBuffer/ReadMe.txt	2004-07-25 21:42:17 UTC (rev 7337)
@@ -0,0 +1,32 @@
+========================================================================
+    CONSOLE APPLICATION : testCircleBuffer Project Overview
+========================================================================
+
+AppWizard has created this testCircleBuffer application for you.
+This file contains a summary of what you will find in each of the files that
+make up your testCircleBuffer application.
+
+
+testCircleBuffer.vcproj
+    This is the main project file for VC++ projects generated using an Application Wizard.
+    It contains information about the version of Visual C++ that generated the file, and
+    information about the platforms, configurations, and project features selected with the
+    Application Wizard.
+
+testCircleBuffer.cpp
+    This is the main application source file.
+
+/////////////////////////////////////////////////////////////////////////////
+Other standard files:
+
+StdAfx.h, StdAfx.cpp
+    These files are used to build a precompiled header (PCH) file
+    named testCircleBuffer.pch and a precompiled types file named StdAfx.obj.
+
+/////////////////////////////////////////////////////////////////////////////
+Other notes:
+
+AppWizard uses "TODO:" comments to indicate parts of the source code you
+should add to or customize.
+
+/////////////////////////////////////////////////////////////////////////////

Added: trunk/oggdsf/src/tests/testCircleBuffer/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/tests/testCircleBuffer/stdafx.cpp	2004-07-25 20:28:53 UTC (rev 7336)
+++ trunk/oggdsf/src/tests/testCircleBuffer/stdafx.cpp	2004-07-25 21:42:17 UTC (rev 7337)
@@ -0,0 +1,8 @@
+// stdafx.cpp : source file that includes just the standard includes
+// testCircleBuffer.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file

Added: trunk/oggdsf/src/tests/testCircleBuffer/stdafx.h
===================================================================
--- trunk/oggdsf/src/tests/testCircleBuffer/stdafx.h	2004-07-25 20:28:53 UTC (rev 7336)
+++ trunk/oggdsf/src/tests/testCircleBuffer/stdafx.h	2004-07-25 21:42:17 UTC (rev 7337)
@@ -0,0 +1,12 @@
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#include <iostream>
+#include <tchar.h>
+
+// TODO: reference additional headers your program requires here

Added: trunk/oggdsf/src/tests/testCircleBuffer/testCircleBuffer.cpp
===================================================================
--- trunk/oggdsf/src/tests/testCircleBuffer/testCircleBuffer.cpp	2004-07-25 20:28:53 UTC (rev 7336)
+++ trunk/oggdsf/src/tests/testCircleBuffer/testCircleBuffer.cpp	2004-07-25 21:42:17 UTC (rev 7337)
@@ -0,0 +1,68 @@
+// testCircleBuffer.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+#include "CircularBuffer.h"
+
+#include <iostream>
+using namespace std;
+
+int __cdecl _tmain(int argc, _TCHAR* argv[])
+{
+
+	int x;
+	cin>>x;
+	const int CIRC_BUFF_SIZE = 4000;
+	const int LOC_BUFF_SIZE = 421;
+	const int LOC_READ_BUFF_BIG_SIZE = 811;
+	const int LOC_READ_BUFF_SMALL_SIZE = 379;
+	const int TIMES_TO_LOOP = 300;
+	CircularBuffer* locCircBuf = new CircularBuffer(CIRC_BUFF_SIZE);
+
+	unsigned char* locBuf = new unsigned char[LOC_BUFF_SIZE];
+
+
+	cout<<"* Testing fill to limit"<<endl;
+	unsigned long locNumWritten = 0;
+	for (int i = 0; i < 12; i++) {
+		locNumWritten = locCircBuf->write(locBuf, LOC_BUFF_SIZE);
+		if (locNumWritten == 0) {
+			cout<<"Buffer full... Wrote 0"<<endl;
+		} else {
+			cout<<"Wrote "<<locNumWritten<<" bytes to buffer"<<endl;
+		}
+
+		cout<< "Space Left : "<<locCircBuf->spaceLeft()<<"   ---   Avail : "<<locCircBuf->numBytesAvail()<<endl;
+	}
+
+	locCircBuf->reset();
+
+	cout<<"* Testing rolling alternate read write"<<endl;
+
+	unsigned char* locReadBuf = new unsigned char[LOC_READ_BUFF_BIG_SIZE];
+	unsigned long locNumRead = 0;
+	locNumWritten = 0;
+
+	for (int i = 0; i < TIMES_TO_LOOP; i++) {
+		locNumWritten = locCircBuf->write(locBuf, LOC_BUFF_SIZE);
+		cout<<"Write attempted "<<LOC_BUFF_SIZE<<" got "<<locNumWritten<<endl;
+
+		cout<<"** Short read test"<<endl;
+		locNumRead = locCircBuf->read(locReadBuf, LOC_READ_BUFF_SMALL_SIZE);
+		cout<<"Read attempted "<<LOC_READ_BUFF_SMALL_SIZE<<" got "<<locNumRead<<endl;
+
+		locNumWritten = locCircBuf->write(locBuf, LOC_BUFF_SIZE);
+		cout<<"Write attempted "<<LOC_BUFF_SIZE<<" got "<<locNumWritten<<endl;
+
+		cout<<"** Long read test"<<endl;
+		locNumRead = locCircBuf->read(locReadBuf, LOC_READ_BUFF_BIG_SIZE);
+		cout<<"Read attempted "<<LOC_READ_BUFF_BIG_SIZE<<" got "<<locNumRead<<endl;
+
+		cout<<"** Long read again to empty test"<<endl;
+		locNumRead = locCircBuf->read(locReadBuf, LOC_READ_BUFF_BIG_SIZE);
+		cout<<"Read attempted "<<LOC_READ_BUFF_BIG_SIZE<<" got "<<locNumRead<<endl;
+
+	}
+	return 0;
+}
+

Added: trunk/oggdsf/src/tests/testCircleBuffer/testCircleBuffer.vcproj
===================================================================
--- trunk/oggdsf/src/tests/testCircleBuffer/testCircleBuffer.vcproj	2004-07-25 20:28:53 UTC (rev 7336)
+++ trunk/oggdsf/src/tests/testCircleBuffer/testCircleBuffer.vcproj	2004-07-25 21:42:17 UTC (rev 7337)
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="testCircleBuffer"
+	ProjectGUID="{191217F4-1F30-426D-A2AB-A9E613D9A401}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="Debug"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\lib\core\ogg\libOOOgg"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="5"
+				UsePrecompiledHeader="3"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"
+				CallingConvention="2"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(OutDir)/testCircleBuffer.exe"
+				LinkIncremental="2"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/testCircleBuffer.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="Release"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="..\..\lib\core\ogg\libOOOgg"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="4"
+				UsePrecompiledHeader="3"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(OutDir)/testCircleBuffer.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\stdafx.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\testCircleBuffer.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+			<File
+				RelativePath=".\stdafx.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+		<File
+			RelativePath=".\ReadMe.txt">
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>



More information about the commits mailing list