Added exception for unknown key
This commit is contained in:
parent
e62ffa206c
commit
c0cb795cee
@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.30907.101
|
|||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Hazelnupp", "Hazelnupp\Hazelnupp.vcxproj", "{9AEAA0C6-9088-4F6E-9224-5C67D3163A17}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Hazelnupp", "Hazelnupp\Hazelnupp.vcxproj", "{9AEAA0C6-9088-4F6E-9224-5C67D3163A17}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Test_Hazelnupp", "Test_Hazelnupp\Test_Hazelnupp.vcxproj", "{B098AA37-A9CC-4BA2-B17D-189B706FDB16}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|x64 = Debug|x64
|
Debug|x64 = Debug|x64
|
||||||
@ -21,6 +23,14 @@ Global
|
|||||||
{9AEAA0C6-9088-4F6E-9224-5C67D3163A17}.Release|x64.Build.0 = Release|x64
|
{9AEAA0C6-9088-4F6E-9224-5C67D3163A17}.Release|x64.Build.0 = Release|x64
|
||||||
{9AEAA0C6-9088-4F6E-9224-5C67D3163A17}.Release|x86.ActiveCfg = Release|Win32
|
{9AEAA0C6-9088-4F6E-9224-5C67D3163A17}.Release|x86.ActiveCfg = Release|Win32
|
||||||
{9AEAA0C6-9088-4F6E-9224-5C67D3163A17}.Release|x86.Build.0 = Release|Win32
|
{9AEAA0C6-9088-4F6E-9224-5C67D3163A17}.Release|x86.Build.0 = Release|Win32
|
||||||
|
{B098AA37-A9CC-4BA2-B17D-189B706FDB16}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{B098AA37-A9CC-4BA2-B17D-189B706FDB16}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{B098AA37-A9CC-4BA2-B17D-189B706FDB16}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
|
{B098AA37-A9CC-4BA2-B17D-189B706FDB16}.Debug|x86.Build.0 = Debug|Win32
|
||||||
|
{B098AA37-A9CC-4BA2-B17D-189B706FDB16}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{B098AA37-A9CC-4BA2-B17D-189B706FDB16}.Release|x64.Build.0 = Release|x64
|
||||||
|
{B098AA37-A9CC-4BA2-B17D-189B706FDB16}.Release|x86.ActiveCfg = Release|Win32
|
||||||
|
{B098AA37-A9CC-4BA2-B17D-189B706FDB16}.Release|x86.Build.0 = Release|Win32
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
@ -296,6 +296,10 @@ const std::string& Hazelnupp::GetExecutableName() const
|
|||||||
|
|
||||||
const Value& Hazelnupp::operator[](const std::string& key) const
|
const Value& Hazelnupp::operator[](const std::string& key) const
|
||||||
{
|
{
|
||||||
|
// Throw exception if param is unknown
|
||||||
|
if (!HasParam(key))
|
||||||
|
throw HazelnuppInvalidKeyException();
|
||||||
|
|
||||||
return *parameters.find(key)->second->GetValue();
|
return *parameters.find(key)->second->GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,26 +27,26 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
<PlatformToolset>v142</PlatformToolset>
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
<PlatformToolset>v142</PlatformToolset>
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
<PlatformToolset>v142</PlatformToolset>
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
<PlatformToolset>v142</PlatformToolset>
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
@ -19,6 +19,13 @@ protected:
|
|||||||
std::string message;
|
std::string message;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class HazelnuppInvalidKeyException : public HazelnuppException
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
HazelnuppInvalidKeyException() : HazelnuppException() {};
|
||||||
|
HazelnuppInvalidKeyException(const std::string& msg) : HazelnuppException(msg) {};
|
||||||
|
};
|
||||||
|
|
||||||
class HazelnuppConstraintException : public HazelnuppException
|
class HazelnuppConstraintException : public HazelnuppException
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
148
Test_Hazelnupp/Test_Hazelnupp.cpp
Normal file
148
Test_Hazelnupp/Test_Hazelnupp.cpp
Normal file
@ -0,0 +1,148 @@
|
|||||||
|
#include "CppUnitTest.h"
|
||||||
|
#include "helper.h"
|
||||||
|
#include "../Hazelnupp/Hazelnupp.h"
|
||||||
|
|
||||||
|
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
||||||
|
|
||||||
|
namespace TestHazelnupp
|
||||||
|
{
|
||||||
|
TEST_CLASS(_Basics)
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Tests the application path gets exported correctly
|
||||||
|
TEST_METHOD(ApplicationPathWorks)
|
||||||
|
{
|
||||||
|
// Setup
|
||||||
|
ArgList args({
|
||||||
|
"/my/fake/path/wahoo.out"
|
||||||
|
});
|
||||||
|
|
||||||
|
// Exercise
|
||||||
|
Hazelnupp nupp(C_Ify(args));
|
||||||
|
|
||||||
|
// Verify
|
||||||
|
Assert::AreEqual(std::string("/my/fake/path/wahoo.out"), nupp.GetExecutableName());
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tests keys exist after parsing
|
||||||
|
TEST_METHOD(BasicParsing_KeysExist)
|
||||||
|
{
|
||||||
|
// Setup
|
||||||
|
ArgList args({
|
||||||
|
"/my/fake/path/wahoo.out",
|
||||||
|
"--my_string",
|
||||||
|
"billybob",
|
||||||
|
"--my_void",
|
||||||
|
"--my_float",
|
||||||
|
"-23.199",
|
||||||
|
"--my_int",
|
||||||
|
"199",
|
||||||
|
"--my_num_list",
|
||||||
|
"1",
|
||||||
|
"2",
|
||||||
|
"3",
|
||||||
|
"4",
|
||||||
|
"--my_str_list",
|
||||||
|
"apple",
|
||||||
|
"banana",
|
||||||
|
"pumpkin",
|
||||||
|
});
|
||||||
|
|
||||||
|
// Exercise
|
||||||
|
Hazelnupp nupp(C_Ify(args));
|
||||||
|
|
||||||
|
// Verify
|
||||||
|
Assert::IsTrue(nupp.HasParam("--my_string"));
|
||||||
|
Assert::IsTrue(nupp.HasParam("--my_void"));
|
||||||
|
Assert::IsTrue(nupp.HasParam("--my_float"));
|
||||||
|
Assert::IsTrue(nupp.HasParam("--my_int"));
|
||||||
|
Assert::IsTrue(nupp.HasParam("--my_num_list"));
|
||||||
|
Assert::IsTrue(nupp.HasParam("--my_str_list"));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tests keys are of the correct type after parsing
|
||||||
|
TEST_METHOD(BasicParsing_CorrectType)
|
||||||
|
{
|
||||||
|
// Setup
|
||||||
|
ArgList args({
|
||||||
|
"/my/fake/path/wahoo.out",
|
||||||
|
"--my_string",
|
||||||
|
"billybob",
|
||||||
|
"--my_void",
|
||||||
|
"--my_float",
|
||||||
|
"-23.199",
|
||||||
|
"--my_int",
|
||||||
|
"199",
|
||||||
|
"--my_num_list",
|
||||||
|
"1",
|
||||||
|
"2",
|
||||||
|
"3",
|
||||||
|
"4",
|
||||||
|
"--my_str_list",
|
||||||
|
"apple",
|
||||||
|
"banana",
|
||||||
|
"pumpkin",
|
||||||
|
});
|
||||||
|
|
||||||
|
// Exercise
|
||||||
|
Hazelnupp nupp(C_Ify(args));
|
||||||
|
|
||||||
|
// Verify
|
||||||
|
Assert::IsTrue(nupp["--my_string"].GetDataType() == DATA_TYPE::STRING);
|
||||||
|
Assert::IsTrue(nupp["--my_void"].GetDataType() == DATA_TYPE::VOID);
|
||||||
|
Assert::IsTrue(nupp["--my_float"].GetDataType() == DATA_TYPE::FLOAT);
|
||||||
|
Assert::IsTrue(nupp["--my_int"].GetDataType() == DATA_TYPE::INT);
|
||||||
|
Assert::IsTrue(nupp["--my_num_list"].GetDataType() == DATA_TYPE::LIST);
|
||||||
|
Assert::IsTrue(nupp["--my_str_list"].GetDataType() == DATA_TYPE::LIST);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tests keys have the correct value after parsing
|
||||||
|
TEST_METHOD(BasicParsing_CorrectValues)
|
||||||
|
{
|
||||||
|
// Setup
|
||||||
|
ArgList args({
|
||||||
|
"/my/fake/path/wahoo.out",
|
||||||
|
"--my_string",
|
||||||
|
"billybob",
|
||||||
|
"--my_void",
|
||||||
|
"--my_float",
|
||||||
|
"-23.199",
|
||||||
|
"--my_int",
|
||||||
|
"199",
|
||||||
|
"--my_num_list",
|
||||||
|
"1",
|
||||||
|
"2",
|
||||||
|
"3",
|
||||||
|
"4",
|
||||||
|
"--my_str_list",
|
||||||
|
"apple",
|
||||||
|
"banana",
|
||||||
|
"pumpkin",
|
||||||
|
});
|
||||||
|
|
||||||
|
// Exercise
|
||||||
|
Hazelnupp nupp(C_Ify(args));
|
||||||
|
|
||||||
|
// Verify
|
||||||
|
Assert::AreEqual(nupp["--my_string"].GetString(), std::string("billybob"));
|
||||||
|
Assert::AreEqual(nupp["--my_float"].GetFloat32(), -23.199);
|
||||||
|
Assert::AreEqual(nupp["--my_int"].GetInt32(), 199);
|
||||||
|
Assert::AreEqual(nupp["--my_num_list"].GetList()[0]->GetInt32(), 1);
|
||||||
|
Assert::AreEqual(nupp["--my_num_list"].GetList()[1]->GetInt32(), 2);
|
||||||
|
Assert::AreEqual(nupp["--my_num_list"].GetList()[2]->GetInt32(), 3);
|
||||||
|
Assert::AreEqual(nupp["--my_num_list"].GetList()[3]->GetInt32(), 4);
|
||||||
|
Assert::AreEqual(nupp["--my_str_list"].GetList()[0]->GetString(), std::string("apple"));
|
||||||
|
Assert::AreEqual(nupp["--my_str_list"].GetList()[1]->GetString(), std::string("banana"));
|
||||||
|
Assert::AreEqual(nupp["--my_str_list"].GetList()[2]->GetString(), std::string("pumpkin"));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
172
Test_Hazelnupp/Test_Hazelnupp.vcxproj
Normal file
172
Test_Hazelnupp/Test_Hazelnupp.vcxproj
Normal file
@ -0,0 +1,172 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<VCProjectVersion>16.0</VCProjectVersion>
|
||||||
|
<ProjectGuid>{B098AA37-A9CC-4BA2-B17D-189B706FDB16}</ProjectGuid>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
<RootNamespace>TestHazelnupp</RootNamespace>
|
||||||
|
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||||
|
<ProjectSubType>NativeUnitTestProject</ProjectSubType>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
<UseOfMfc>false</UseOfMfc>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
<UseOfMfc>false</UseOfMfc>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
<UseOfMfc>false</UseOfMfc>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
<UseOfMfc>false</UseOfMfc>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="Shared">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<UseFullPaths>true</UseFullPaths>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<AdditionalLibraryDirectories>$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<UseFullPaths>true</UseFullPaths>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<AdditionalLibraryDirectories>$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<UseFullPaths>true</UseFullPaths>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<AdditionalLibraryDirectories>$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<UseFullPaths>true</UseFullPaths>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<AdditionalLibraryDirectories>$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="Test_Hazelnupp.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Hazelnupp\Hazelnupp.vcxproj">
|
||||||
|
<Project>{9aeaa0c6-9088-4f6e-9224-5c67d3163a17}</Project>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="helper.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
27
Test_Hazelnupp/Test_Hazelnupp.vcxproj.filters
Normal file
27
Test_Hazelnupp/Test_Hazelnupp.vcxproj.filters
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="Quelldateien">
|
||||||
|
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||||
|
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Headerdateien">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Ressourcendateien">
|
||||||
|
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||||
|
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="Test_Hazelnupp.cpp">
|
||||||
|
<Filter>Quelldateien</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="helper.h">
|
||||||
|
<Filter>Headerdateien</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
6
Test_Hazelnupp/helper.h
Normal file
6
Test_Hazelnupp/helper.h
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#define C_Ify(vector) vector.size(), vector.data()
|
||||||
|
|
||||||
|
typedef std::vector<const char*> ArgList;
|
Loading…
x
Reference in New Issue
Block a user