diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2010-07-21 16:15:28 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2010-07-21 16:15:28 -0700 |
commit | d2350db627b5ef7c9ebe6fd150b3007b0af1e660 (patch) | |
tree | 6817d8679ad3efadb78e7c275429fd9372ee4058 /tools/NUnit/samples/cpp/cpp-cli/failures | |
parent | b5c8335f528acbca046ca2844f8e4c12cfa9cba3 (diff) | |
parent | 4f2ccab7a53819c7d0c4008626995e95ece4dd34 (diff) | |
download | DotNetOpenAuth-d2350db627b5ef7c9ebe6fd150b3007b0af1e660.zip DotNetOpenAuth-d2350db627b5ef7c9ebe6fd150b3007b0af1e660.tar.gz DotNetOpenAuth-d2350db627b5ef7c9ebe6fd150b3007b0af1e660.tar.bz2 |
Merge branch 'v3.4' into oauth2
Conflicts:
projecttemplates/RelyingPartyDatabase/RelyingPartyDatabase.dbproj
projecttemplates/RelyingPartyLogic/CreateDatabase.sql
samples/OAuthConsumerWpf/OAuthConsumerWpf.csproj
src/DotNetOpenAuth.Test/Messaging/MessagingUtilitiesTests.cs
src/DotNetOpenAuth.Test/OAuth/ChannelElements/OAuthChannelTests.cs
src/DotNetOpenAuth/Messaging/MessagingStrings.resx
src/DotNetOpenAuth/Messaging/MessagingUtilities.cs
src/DotNetOpenAuth/OAuth/ChannelElements/OAuthChannel.cs
src/version.txt
Diffstat (limited to 'tools/NUnit/samples/cpp/cpp-cli/failures')
5 files changed, 364 insertions, 0 deletions
diff --git a/tools/NUnit/samples/cpp/cpp-cli/failures/AssemblyInfo.cpp b/tools/NUnit/samples/cpp/cpp-cli/failures/AssemblyInfo.cpp new file mode 100644 index 0000000..e64d6ee --- /dev/null +++ b/tools/NUnit/samples/cpp/cpp-cli/failures/AssemblyInfo.cpp @@ -0,0 +1,56 @@ +using namespace System::Reflection; +using namespace System::Runtime::CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly:AssemblyTitleAttribute("")]; +[assembly:AssemblyDescriptionAttribute("")]; +[assembly:AssemblyConfigurationAttribute("")]; +[assembly:AssemblyCompanyAttribute("")]; +[assembly:AssemblyProductAttribute("")]; +[assembly:AssemblyCopyrightAttribute("")]; +[assembly:AssemblyTrademarkAttribute("")]; +[assembly:AssemblyCultureAttribute("")]; + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the value or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly:AssemblyVersionAttribute("2.2.0.0")]; + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project directory. +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly:AssemblyDelaySignAttribute(false)]; +[assembly:AssemblyKeyFileAttribute("")]; +[assembly:AssemblyKeyNameAttribute("")]; + diff --git a/tools/NUnit/samples/cpp/cpp-cli/failures/cpp-cli-failures.build b/tools/NUnit/samples/cpp/cpp-cli/failures/cpp-cli-failures.build new file mode 100644 index 0000000..8cf139e --- /dev/null +++ b/tools/NUnit/samples/cpp/cpp-cli/failures/cpp-cli-failures.build @@ -0,0 +1,24 @@ +<?xml version="1.0"?> +<project name="cpp-cli-failures" default="build"> + + <include buildfile="../../../samples.common"/> + + <patternset id="source-files"> + <include name="AssemblyInfo.cpp" /> + <include name="cppsample.cpp" /> + <include name="cppsample.h" /> + </patternset> + + <target name="packagex"> + <copy todir="${package.samples.dir}/cpp/cpp-cli/failures"> + <fileset basedir="."> + <include name="cpp-cli-failures.vcproj" /> + <include name="cpp-cli-failures.build" /> + <include name="AssemblyInfo.cpp" /> + <include name="cppsample.cpp" /> + <include name="cppsample.h" /> + </fileset> + </copy> + </target> + +</project>
\ No newline at end of file diff --git a/tools/NUnit/samples/cpp/cpp-cli/failures/cpp-cli-failures.vcproj b/tools/NUnit/samples/cpp/cpp-cli/failures/cpp-cli-failures.vcproj new file mode 100644 index 0000000..364a6be --- /dev/null +++ b/tools/NUnit/samples/cpp/cpp-cli/failures/cpp-cli-failures.vcproj @@ -0,0 +1,208 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="cpp-cli-failures" + ProjectGUID="{A0987BCD-AFE6-40E4-95A8-ADA7ADB7E97D}" + RootNamespace="cpp-failures" + Keyword="ManagedCProj" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory="Debug" + IntermediateDirectory="Debug" + ConfigurationType="2" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" + CharacterSet="2" + ManagedExtensions="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalUsingDirectories="" + PreprocessorDefinitions="WIN32;_DEBUG" + MinimalRebuild="false" + BasicRuntimeChecks="0" + RuntimeLibrary="3" + UsePrecompiledHeader="0" + WarningLevel="3" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + OutputFile="$(OutDir)/cpp-cli-failures.dll" + LinkIncremental="2" + GenerateDebugInformation="true" + AssemblyDebug="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory="Release" + IntermediateDirectory="Release" + ConfigurationType="2" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" + CharacterSet="2" + ManagedExtensions="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="2" + InlineFunctionExpansion="1" + AdditionalUsingDirectories="" + PreprocessorDefinitions="WIN32;NDEBUG" + MinimalRebuild="false" + RuntimeLibrary="2" + UsePrecompiledHeader="0" + WarningLevel="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + OutputFile="$(OutDir)/cpp-cli-failures.dll" + LinkIncremental="1" + GenerateDebugInformation="true" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + <AssemblyReference + RelativePath="..\..\..\..\solutions\vs2005\NUnitFramework\framework\bin\Debug\nunit.framework.dll" + AssemblyName="nunit.framework, Version=2.5.0.0, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL" + /> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm" + > + <File + RelativePath="AssemblyInfo.cpp" + > + </File> + <File + RelativePath="cppsample.cpp" + > + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl;inc" + > + <File + RelativePath="cppsample.h" + > + </File> + </Filter> + <Filter + Name="Resource Files" + Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;r" + > + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/tools/NUnit/samples/cpp/cpp-cli/failures/cppsample.cpp b/tools/NUnit/samples/cpp/cpp-cli/failures/cppsample.cpp new file mode 100644 index 0000000..f5aea7c --- /dev/null +++ b/tools/NUnit/samples/cpp/cpp-cli/failures/cppsample.cpp @@ -0,0 +1,48 @@ +// **************************************************************** +// This is free software licensed under the NUnit license. You +// may obtain a copy of the license as well as information regarding +// copyright ownership at http://nunit.org/?p=license&r=2.4. +// **************************************************************** + +#include "cppsample.h" + +namespace NUnitSamples { + + void SimpleCPPSample::Init() { + fValue1 = 2; + fValue2 = 3; + } + + void SimpleCPPSample::Add() { + int result = fValue1 + fValue2; + Assert::AreEqual(6,result); + } + + void SimpleCPPSample::DivideByZero() + { + int zero= 0; + int result= 8/zero; + } + + void SimpleCPPSample::Equals() { + Assert::AreEqual(12, 12, "Integer"); + Assert::AreEqual(12L, 12L, "Long"); + Assert::AreEqual('a', 'a', "Char"); + + + Assert::AreEqual(12, 13, "Expected Failure (Integer)"); + Assert::AreEqual(12.0, 11.99, 0.0, "Expected Failure (Double)"); + } + + void SimpleCPPSample::IgnoredTest() + { + throw gcnew InvalidCastException(); + } + + void SimpleCPPSample::ExpectAnException() + { + throw gcnew InvalidCastException(); + } + +} + diff --git a/tools/NUnit/samples/cpp/cpp-cli/failures/cppsample.h b/tools/NUnit/samples/cpp/cpp-cli/failures/cppsample.h new file mode 100644 index 0000000..863feb5 --- /dev/null +++ b/tools/NUnit/samples/cpp/cpp-cli/failures/cppsample.h @@ -0,0 +1,28 @@ +// **************************************************************** +// This is free software licensed under the NUnit license. You +// may obtain a copy of the license as well as information regarding +// copyright ownership at http://nunit.org/?p=license&r=2.4. +// **************************************************************** + +#pragma once + +using namespace System; +using namespace NUnit::Framework; + +namespace NUnitSamples +{ + [TestFixture] + public ref class SimpleCPPSample + { + int fValue1; + int fValue2; + public: + [SetUp] void Init(); + + [Test] void Add(); + [Test] void DivideByZero(); + [Test] void Equals(); + [Test] [Ignore("ignored test")] void IgnoredTest(); + [Test] [ExpectedException(InvalidOperationException::typeid)] void ExpectAnException(); + }; +} |