diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..8a22bbcd --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ +### Purpose of this PR + +* Description of feature/change. +* Which part of OpenTK does this affect (Math, OpenGL, Platform, Input, etc). +* Links to screenshots, design docs, user docs, etc. + +### Testing status + +* Explanation of what’s tested, how tested and existing or new automation tests. +* Can include manual testing by self. +* Specify test plans. +* Rarely acceptable to have no testing. + +### Comments + +* Any other comments to help understand the change. diff --git a/.gitignore b/.gitignore index 9399ea25..1f55e3f2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,31 +1,63 @@ +# ============================================= +# Visual Studio & Associated technologies +# ============================================= + ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore # User-specific files *.suo *.user +*.userosscache *.sln.docstates -# Xamarin Studio / monodevelop user-specific +# User-specific files (MonoDevelop/Xamarin Studio) *.userprefs -*.dll.mdb -*.exe.mdb # Build results - [Dd]ebug/ +[Dd]ebugPublic/ [Rr]elease/ +[Rr]eleases/ x64/ -build/ +x86/ +bld/ [Bb]in/ [Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ +**/Properties/launchSettings.json + *_i.c *_p.c +*_i.h *.ilk *.meta *.obj @@ -45,24 +77,31 @@ build/ *.vssscc .builds *.pidb -*.log +*.svclog *.scc +# Chutzpah Test files +_Chutzpah* + # Visual C++ cache files ipch/ *.aps *.ncb +*.opendb *.opensdf *.sdf *.cachefile +*.VC.db +*.VC.VC.opendb # Visual Studio profiler *.psess *.vsp *.vspx +*.sap -# Other Visual Studio data -.vs/ +# TFS 2012 Local Workspace +$tf/ # Guidance Automation Toolkit *.gpState @@ -70,6 +109,10 @@ ipch/ # ReSharper is a .NET coding add-in _ReSharper*/ *.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode # TeamCity is a build add-in _TeamCity* @@ -77,9 +120,21 @@ _TeamCity* # DotCover is a Code Coverage Tool *.dotCover +# Visual Studio code coverage results +*.coverage +*.coveragexml + # NCrunch -*.ncrunch* +_NCrunch_* .*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ # Installshield output folder [Ee]xpress/ @@ -98,57 +153,158 @@ DocProject/Help/html publish/ # Publish Web Output -*.Publish.xml +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj -# Enable nuget.exe in the .nuget folder (though normally executables are not tracked) -!.nuget/NuGet.exe +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ -# Windows Azure Build Output -csx +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ *.build.csdef -# Windows Store app package directory +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ # Others -sql/ -*.Cache ClientBin/ -[Ss]tyle[Cc]op.* ~$* *~ *.dbmdl -*.[Pp]ublish.xml +*.dbproj.schemaview +*.jfm *.pfx *.publishsettings +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ # RIA/Silverlight projects Generated_Code/ -# Backup & report files from converting an old project file to a newer -# Visual Studio version. Backup files are not needed, because we have git ;-) +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML UpgradeLog*.htm # SQL Server files -App_Data/*.mdf -App_Data/*.ldf +*.mdf +*.ldf +*.ndf +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings -#LightSwitch generated files -GeneratedArtifacts/ -_Pvt_Extensions/ -ModelManifest.xml +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Typescript v1 declaration files +typings/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs # ========================= # Windows detritus # ========================= -# Windows image file caches +# Windows thumbnail cache files Thumbs.db ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump # Folder config file Desktop.ini @@ -156,8 +312,46 @@ Desktop.ini # Recycle Bin used on file shares $RECYCLE.BIN/ -# Mac desktop service store files -.DS_Store +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# =========== +# Macintosh +# =========== + +# General +*.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk # =================================================== # Exclude F# project specific directories and files @@ -174,6 +368,8 @@ temp/ # Test results produced by build TestResults.xml +output.mlpd +coverage.xml # Nuget outputs nuget/*.nupkg @@ -187,3 +383,165 @@ docs/content/license.md docs/content/release-notes.md .fake docs/tools/FSharp.Formatting.svclog + +# =========== +# Covers JetBrains IDEs: Rider, IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 +# =========== + +# User-specific stuff: +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/dictionaries + +# Sensitive or high-churn files: +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.xml +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml + +# Gradle: +.idea/**/gradle.xml +.idea/**/libraries + +# CMake +cmake-build-debug/ + +# Mongo Explorer plugin: +.idea/**/mongoSettings.xml + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# ============ +# MonoDevelop +# ============ + +#User Specific +*.userprefs +*.usertasks + +#Mono Project Files +*.pidb +*.resources +test-results/ + +# ================ +# Linux-specific +# ================ + +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +# ============ +# VS Code +# ============ + +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# ============ +# Emacs +# ============ + +# -*- mode: gitignore; -*- +*~ +\#*\# +/.emacs.desktop +/.emacs.desktop.lock +*.elc +auto-save-list +tramp +.\#* + +# Org-mode +.org-id-locations +*_archive + +# flymake-mode +*_flymake.* + +# eshell files +/eshell/history +/eshell/lastdir + +# elpa packages +/elpa/ + +# reftex files +*.rel + +# AUCTeX auto folder +/auto/ + +# cask packages +.cask/ +dist/ + +# Flycheck +flycheck_*.el + +# server auth directory +/server/ + +# projectiles files +.projectile + +# directory configuration +.dir-locals.el + +# =========== +# Vim +# =========== + +# Swap +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-v][a-z] +[._]sw[a-p] + +# Session +Session.vim + +# Temporary +.netrwhist +*~ +# Auto-generated tag files +tags diff --git a/.travis.yml b/.travis.yml index 88b294ad..2783d9fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,20 @@ language: csharp -sudo: false # use the new container-based Travis infrastructure +sudo: false # use the new container-based Travis infrastructure before_install: - chmod +x build.sh - -script: - - ./build.sh NuGet + +before_script: + # Start a virtual framebuffer as described: https://docs.travis-ci.com/user/gui-and-headless-browsers/ + - "export DISPLAY=:99.0" + - "sh -e /etc/init.d/xvfb start" + - sleep 3 # give xvfb some time to start + +script: + - travis_wait ./build.sh NuGet + +after_script: + - mono --debug --profile=log:coverage,covfilter=+OpenTK,covfilter=-OpenTK.Tests,covfilter=-FSharp.Core,covfilter=-FsCheck,covfilter=-xunit.assert "packages/xunit.runner.console/tools/xunit.console.exe" "tests/OpenTK.Tests/bin/Release/OpenTK.Tests.dll" -parallel none + - mprof-report --reports=coverage --coverage-out=coverage.xml output.mlpd + - bash <(curl -s https://codecov.io/bash) diff --git a/OpenTK.sln b/OpenTK.sln index a33d8dd6..36f4ca74 100644 --- a/OpenTK.sln +++ b/OpenTK.sln @@ -21,8 +21,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTK.GLWidget", "src\Open EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{1857BB8E-1A35-4EBF-9F6D-685F11DC025B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTK.Tests", "tests\OpenTK.Tests\OpenTK.Tests.csproj", "{930A780C-A67C-422F-9EED-DB38DAA47AB0}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test.API.Desktop", "tests\Test.API.Desktop\Test.API.Desktop.csproj", "{C4DDD20F-CB4E-43F4-A75C-4A3D668E1F99}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".paket", ".paket", "{F1A57014-71CE-4032-A652-01B7E35E14DB}" @@ -38,6 +36,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "project", "project", "{5EEE RELEASE_NOTES.md = RELEASE_NOTES.md EndProjectSection EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "OpenTK.Tests", "tests\OpenTK.Tests\OpenTK.Tests.fsproj", "{6801C263-ADDA-4A7B-979D-649BCB5A1DF7}" +EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "OpenTK.Tests.Integration", "tests\OpenTK.Tests.Integration\OpenTK.Tests.Integration.fsproj", "{522D9279-3ED6-475F-867A-6AE69A53C24A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -76,23 +78,25 @@ Global {A625BE87-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU {A625BE87-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU {A625BE87-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {930A780C-A67C-422F-9EED-DB38DAA47AB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {930A780C-A67C-422F-9EED-DB38DAA47AB0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {930A780C-A67C-422F-9EED-DB38DAA47AB0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {930A780C-A67C-422F-9EED-DB38DAA47AB0}.Release|Any CPU.Build.0 = Release|Any CPU {C4DDD20F-CB4E-43F4-A75C-4A3D668E1F99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C4DDD20F-CB4E-43F4-A75C-4A3D668E1F99}.Debug|Any CPU.Build.0 = Debug|Any CPU {C4DDD20F-CB4E-43F4-A75C-4A3D668E1F99}.Release|Any CPU.ActiveCfg = Release|Any CPU {C4DDD20F-CB4E-43F4-A75C-4A3D668E1F99}.Release|Any CPU.Build.0 = Release|Any CPU + {6801C263-ADDA-4A7B-979D-649BCB5A1DF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6801C263-ADDA-4A7B-979D-649BCB5A1DF7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6801C263-ADDA-4A7B-979D-649BCB5A1DF7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6801C263-ADDA-4A7B-979D-649BCB5A1DF7}.Release|Any CPU.Build.0 = Release|Any CPU + {522D9279-3ED6-475F-867A-6AE69A53C24A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {522D9279-3ED6-475F-867A-6AE69A53C24A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {522D9279-3ED6-475F-867A-6AE69A53C24A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {522D9279-3ED6-475F-867A-6AE69A53C24A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {930A780C-A67C-422F-9EED-DB38DAA47AB0} = {1857BB8E-1A35-4EBF-9F6D-685F11DC025B} {C4DDD20F-CB4E-43F4-A75C-4A3D668E1F99} = {1857BB8E-1A35-4EBF-9F6D-685F11DC025B} - EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution - StartupItem = Source\Examples\OpenTK.Examples.csproj + {6801C263-ADDA-4A7B-979D-649BCB5A1DF7} = {1857BB8E-1A35-4EBF-9F6D-685F11DC025B} + {522D9279-3ED6-475F-867A-6AE69A53C24A} = {1857BB8E-1A35-4EBF-9F6D-685F11DC025B} EndGlobalSection EndGlobal diff --git a/README.md b/README.md index da67882c..6337f131 100644 --- a/README.md +++ b/README.md @@ -18,10 +18,19 @@ Project website: https://opentk.github.io/ Official git repository: https://github.com/opentk/opentk +Build Status +======== + +| Platform | Status | +| -------------- | -------------- | +| Windows | [![Build status](https://ci.appveyor.com/api/projects/status/opentk/branch/develop?svg=true)](https://ci.appveyor.com/project/varon/opentk/branch/develop) | +| Mono/Linux | [![Build status](https://travis-ci.org/opentk/opentk.svg?branch=develop)](https://travis-ci.org/opentk/opentk) | + + Features ======== -- Create cutting-edge graphics with OpenGL 4.4 and OpenGL ES 3.0 +- Create cutting-edge graphics with OpenGL 4.6 and OpenGL ES 3.0 - Spice up your GUI with 3d acceleration - Improve your code flow with strong types and inline documentation - Write once run everywhere @@ -35,6 +44,7 @@ Instructions ============ The simplest way to use OpenTK in your project is to install the [NuGet package](http://www.nuget.org/packages/OpenTK/). +If you want to try out the latest development build from the `develop` branch, we also have a [MyGet feed](https://www.myget.org/F/opentk-develop/api/v3/index.json). Note what installing NuGet package will add reference to OpenTK.dll, but OpenTK.dll.config will not be copied to the project output directory automatically, so you need to add it to your project @@ -54,6 +64,14 @@ cd opentk # Enter the source directory News ==== +### 2017-05-08 + +A pre-release package is available. + +https://www.nuget.org/packages/OpenTK/3.0.0-pre + +https://www.nuget.org/packages/OpenTK.GLControl/3.0.0-pre + ### 2016-09-23 OpenTK 2.0.0 is now available for download from [Nuget](https://www.nuget.org/packages/OpenTK/2.0.0). @@ -163,7 +181,7 @@ Requirements Documentation ============= -Your favorite IDE will display inline documentation for all OpenTK APIs. Additional information can be found in the [OpenTK Manual](http://www.opentk.com/doc) and in the [opentk/Documentation/](https://github.com/opentk/opentk/tree/develop/Documentation) folder. +Your favorite IDE will display inline documentation for all OpenTK APIs. Additional information can be found in the [OpenTK Manual](http://web.archive.org/web/20150325224427/http://www.opentk.com/doc). Technical documentation about the implementation of OpenTK can be found in the [Technical Wiki](https://github.com/opentk/opentk/wiki). diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 5b9f46fb..4c131e83 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,4 +1,22 @@ -### 2.0.0 - alpha +### 3.0.0-pre + * Support for OpenGL 4.6 + * Replaced JoystickButton enum with simple long. (breaking API change) + * Increase available joystick buttons to 64. + * Add support for OpenGL ES3 through Angle + DIrect3D. + * Fix 2 crashes on android + * Move to built-in System.Diagnostics.Debug for Android + iOS + * Fix for certain joysticks returning invalid HID pages. + * Fix for certain joysticks with negative axis range being inverted. + * Fix Xbox controller D-pad on windows + * Fix joystick hat position sticking on Linux + * Enhance xbox button detection to include GUIDE button. + * Fix iOS GL bindings issue introduced by 2ea8334 + * Fix crash on setting time to <= 0 for iOS + Android. + * Several minor XML documentation fixes and enhancements + * Fix for angle backbuffer size issue on window resize + * Possible fix for broken GLControl package. + +### 2.0.0 * Moved to new FAKE/Paket based build system * Removed superfluous release configurations * Numerous other fixes and enhancements diff --git a/appveyor.yml b/appveyor.yml index 92796ce4..28f1f89c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,3 +1,4 @@ +image: Visual Studio 2017 init: - git config --global core.autocrlf input build_script: diff --git a/build.cmd b/build.cmd index 79c3cd5c..2b2c27c9 100644 --- a/build.cmd +++ b/build.cmd @@ -15,4 +15,14 @@ IF NOT EXIST build.fsx ( .paket\paket.exe update packages\FAKE\tools\FAKE.exe init.fsx ) -packages\FAKE\tools\FAKE.exe build.fsx %* + +SET BuildTarget= +if "%BuildRunner%" == "MyGet" ( + SET BuildTarget=NuGet + + :: Replace the existing release notes file with one for this build only + echo ### %PackageVersion% > RELEASE_NOTES.md + echo * git build >> RELEASE_NOTES.md +) + +packages\FAKE\tools\FAKE.exe build.fsx %* %BuildTarget% \ No newline at end of file diff --git a/build.fsx b/build.fsx index 012efed9..530bb12a 100644 --- a/build.fsx +++ b/build.fsx @@ -42,7 +42,7 @@ let tags = "OpenTK OpenGL OpenGLES GLES OpenAL C# F# VB .NET Mono Vector Math Ga let copyright = "Copyright (c) 2006 - 2016 Stefanos Apostolopoulos for the Open Toolkit library." -// File system information +// File system information let solutionFile = "OpenTK.sln" // Pattern specifying assemblies to be tested using NUnit @@ -50,7 +50,7 @@ let testAssemblies = "tests/**/bin/Release/*Tests*.dll" // Git configuration (used for publishing documentation in gh-pages branch) // The profile where the project is posted -let gitOwner = "opentk" +let gitOwner = "opentk" let gitHome = "https://github.com/" + gitOwner // The name of the project on GitHub @@ -70,7 +70,7 @@ let isXamarinPlatform = false //EnvironmentHelper.isMacOS || Environment.OSVersi // Helper active pattern for project types -let (|Fsproj|Csproj|Vbproj|) (projFileName:string) = +let (|Fsproj|Csproj|Vbproj|) (projFileName:string) = match projFileName with | f when f.EndsWith "fsproj" -> Fsproj | f when f.EndsWith "csproj" -> Csproj @@ -78,8 +78,8 @@ let (|Fsproj|Csproj|Vbproj|) (projFileName:string) = | _ -> failwith (sprintf "Project file %s not supported. Unknown project type." projFileName) -let activeProjects = - let xamarinFilter f = +let activeProjects = + let xamarinFilter f = if isXamarinPlatform then f else @@ -88,13 +88,13 @@ let activeProjects = -- "**/OpenTK.iOS.csproj" !! "src/**/*.??proj" - -- "**/OpenTK.GLWidget.csproj" + ++ "tests/**/OpenTK.Tests*.fsproj" |> xamarinFilter // Generate assembly info files with the right version & up-to-date information Target "AssemblyInfo" (fun _ -> let getAssemblyInfoAttributes (projectName:string) = - let projectName = + let projectName = if projectName.Contains(".iOS") || projectName.Contains(".Android") then projectName.Split('.').[0] else @@ -105,11 +105,12 @@ Target "AssemblyInfo" (fun _ -> Attribute.Version release.AssemblyVersion Attribute.FileVersion release.AssemblyVersion Attribute.CLSCompliant true - Attribute.Copyright copyright ] + Attribute.Copyright copyright + ] let getProjectDetails projectPath = let projectName = System.IO.Path.GetFileNameWithoutExtension(projectPath) - ( projectPath, + ( projectPath, projectName, System.IO.Path.GetDirectoryName(projectPath), (getAssemblyInfoAttributes projectName) @@ -126,7 +127,7 @@ Target "AssemblyInfo" (fun _ -> ) // Copies binaries from default VS location to expected bin folder -// But keeps a subdirectory structure for each project in the +// But keeps a subdirectory structure for each project in the // src folder to support multiple project outputs Target "CopyBinaries" (fun _ -> activeProjects @@ -146,7 +147,7 @@ Target "Clean" (fun _ -> Target "Build" (fun _ -> activeProjects - |> MSBuildRelease "" "Rebuild" + |> MSBuildRelease "" "Build" |> ignore ) @@ -174,10 +175,10 @@ Target "NuGet" (fun _ -> "OpenTK.iOS" ] - Paket.Pack(fun p -> + Paket.Pack(fun p -> { p with OutputPath = "bin" - ExcludedTemplates = "OpenTK.GLWidget" :: xamExcludes + ExcludedTemplates = xamExcludes Version = release.NugetVersion ReleaseNotes = toLines release.Notes}) ) @@ -194,10 +195,10 @@ Target "All" DoNothing ==> "AssemblyInfo" ==> "Build" ==> "CopyBinaries" -// ==> "RunTests" + ==> "RunTests" ==> "All" -"All" +"All" ==> "NuGet" diff --git a/build.sh b/build.sh index fe082dd3..576d97e2 100755 --- a/build.sh +++ b/build.sh @@ -33,5 +33,4 @@ run .paket/paket.exe restore [ ! -e build.fsx ] && run .paket/paket.exe update [ ! -e build.fsx ] && run packages/FAKE/tools/FAKE.exe init.fsx -run packages/FAKE/tools/FAKE.exe "$@" $FSIARGS build.fsx - +run packages/FAKE/tools/FAKE.exe "$@" $FSIARGS build.fsx \ No newline at end of file diff --git a/paket.dependencies b/paket.dependencies index f7f692c6..965551f6 100644 --- a/paket.dependencies +++ b/paket.dependencies @@ -2,10 +2,13 @@ source https://nuget.org/api/v2 #Open packages +nuget CommandLineParser >= 2.1.1-beta nuget FSharp.Formatting +nuget FsCheck nuget FsCheck.Xunit +nuget StyleCop.Analyzers nuget xunit.runner.console nuget xunit.assert nuget FAKE -nuget Mono.Cecil -nuget GtkSharp \ No newline at end of file +nuget Mono.Cecil >= 0.10.0-beta6 +nuget gtk-sharp3 \ No newline at end of file diff --git a/paket.lock b/paket.lock index 0b74580d..17954511 100644 --- a/paket.lock +++ b/paket.lock @@ -1,165 +1,620 @@ NUGET remote: https://www.nuget.org/api/v2 - FAKE (4.28) - FsCheck (2.4) - FSharp.Core (>= 3.1.2.5) - FsCheck.Xunit (2.4) - FsCheck (>= 2.4) - xunit.extensibility.execution (>= 2.1 < 3.0) + CommandLineParser (2.1.1-beta) + System.Collections (>= 4.0.11-rc2-24027) - restriction: >= netstandard1.5 + System.Console (>= 4.0.0-rc2-24027) - restriction: >= netstandard1.5 + System.Diagnostics.Debug (>= 4.0.11-rc2-24027) - restriction: >= netstandard1.5 + System.Globalization (>= 4.0.11-rc2-24027) - restriction: >= netstandard1.5 + System.IO (>= 4.1.0-rc2-24027) - restriction: >= netstandard1.5 + System.Linq (>= 4.1.0-rc2-24027) - restriction: >= netstandard1.5 + System.Linq.Expressions (>= 4.0.11-rc2-24027) - restriction: >= netstandard1.5 + System.Reflection (>= 4.1.0-rc2-24027) - restriction: >= netstandard1.5 + System.Reflection.Extensions (>= 4.0.1-rc2-24027) - restriction: >= netstandard1.5 + System.Reflection.TypeExtensions (>= 4.1.0-rc2-24027) - restriction: >= netstandard1.5 + System.Resources.ResourceManager (>= 4.0.1-rc2-24027) - restriction: >= netstandard1.5 + System.Runtime (>= 4.1.0-rc2-24027) - restriction: >= netstandard1.5 + System.Runtime.Extensions (>= 4.1.0-rc2-24027) - restriction: >= netstandard1.5 + FAKE (4.62.5) + FsCheck (2.9) + FSharp.Core (>= 4.1) - restriction: < netstandard1.6 + FSharp.Core (>= 4.1.17) - restriction: >= netstandard1.6 + NETStandard.Library (>= 1.6.1) - restriction: >= netstandard1.6 + FsCheck.Xunit (2.9) + FsCheck (>= 2.9) + FSharp.Core (>= 4.1.17) - restriction: >= netstandard1.6 + NETStandard.Library (>= 1.6.1) - restriction: >= netstandard1.6 + xunit.abstractions (>= 2.0.1) - restriction: >= netstandard1.6 + xunit.core (>= 2.2) - restriction: >= netstandard1.6 + xunit.extensibility.execution (>= 2.2 < 3.0) - restriction: < netstandard1.6 FSharp.Compiler.Service (2.0.0.6) - FSharp.Core (4.0.0.1) + FSharp.Core (4.2.1) + System.Collections (>= 4.0.11) - restriction: >= netstandard1.6 + System.Console (>= 4.0) - restriction: >= netstandard1.6 + System.Diagnostics.Debug (>= 4.0.11) - restriction: >= netstandard1.6 + System.Diagnostics.Tools (>= 4.0.1) - restriction: >= netstandard1.6 + System.Globalization (>= 4.0.11) - restriction: >= netstandard1.6 + System.IO (>= 4.1) - restriction: >= netstandard1.6 + System.Linq (>= 4.1) - restriction: >= netstandard1.6 + System.Linq.Expressions (>= 4.1) - restriction: >= netstandard1.6 + System.Linq.Queryable (>= 4.0.1) - restriction: >= netstandard1.6 + System.Net.Requests (>= 4.0.11) - restriction: >= netstandard1.6 + System.Reflection (>= 4.1) - restriction: >= netstandard1.6 + System.Reflection.Extensions (>= 4.0.1) - restriction: >= netstandard1.6 + System.Resources.ResourceManager (>= 4.0.1) - restriction: >= netstandard1.6 + System.Runtime (>= 4.1) - restriction: >= netstandard1.6 + System.Runtime.Extensions (>= 4.1) - restriction: >= netstandard1.6 + System.Runtime.Numerics (>= 4.0.1) - restriction: >= netstandard1.6 + System.Text.RegularExpressions (>= 4.1) - restriction: >= netstandard1.6 + System.Threading (>= 4.0.11) - restriction: >= netstandard1.6 + System.Threading.Tasks (>= 4.0.11) - restriction: >= netstandard1.6 + System.Threading.Tasks.Parallel (>= 4.0.1) - restriction: >= netstandard1.6 + System.Threading.Thread (>= 4.0) - restriction: >= netstandard1.6 + System.Threading.ThreadPool (>= 4.0.10) - restriction: >= netstandard1.6 + System.Threading.Timer (>= 4.0.1) - restriction: >= netstandard1.6 FSharp.Formatting (2.14.4) FSharp.Compiler.Service (2.0.0.6) FSharpVSPowerTools.Core (>= 2.3 < 2.4) FSharpVSPowerTools.Core (2.3) FSharp.Compiler.Service (>= 2.0.0.3) - GtkSharp (3.1.3) - Mono.Cecil (0.9.6.1) - System.Collections (4.0.10) - framework: dnxcore50 - System.Diagnostics.Debug (>= 4.0) - framework: dnxcore50 - System.Resources.ResourceManager (>= 4.0) - framework: dnxcore50 - System.Runtime (>= 4.0) - framework: dnxcore50 - System.Runtime (>= 4.0.20) - framework: dnxcore50 - System.Runtime.Extensions (>= 4.0) - framework: dnxcore50 - System.Threading (>= 4.0) - framework: dnxcore50 - System.Diagnostics.Contracts (4.0) - framework: dnxcore50 - System.Runtime (>= 4.0) - framework: dnxcore50 - System.Diagnostics.Debug (4.0.10) - framework: dnxcore50 - System.Runtime (>= 4.0) - framework: dnxcore50 - System.Globalization (4.0.10) - framework: dnxcore50 - System.Runtime (>= 4.0) - framework: dnxcore50 - System.IO (4.0.10) - framework: dnxcore50 - System.Globalization (>= 4.0) - framework: dnxcore50 - System.Runtime (>= 4.0.20) - framework: dnxcore50 - System.Text.Encoding (>= 4.0) - framework: dnxcore50 - System.Text.Encoding (>= 4.0.10) - framework: dnxcore50 - System.Text.Encoding.Extensions (>= 4.0) - framework: dnxcore50 - System.Threading (>= 4.0) - framework: dnxcore50 - System.Threading.Tasks (>= 4.0) - framework: dnxcore50 - System.Linq (4.0) - framework: dnxcore50 - System.Collections (>= 4.0.10) - framework: dnxcore50 - System.Diagnostics.Debug (>= 4.0.10) - framework: dnxcore50 - System.Resources.ResourceManager (>= 4.0) - framework: dnxcore50 - System.Runtime (>= 4.0.20) - framework: dnxcore50 - System.Runtime.Extensions (>= 4.0.10) - framework: dnxcore50 - System.Linq.Expressions (4.0.10) - framework: dnxcore50 - System.Collections (>= 4.0) - framework: dnxcore50 - System.Diagnostics.Debug (>= 4.0) - framework: dnxcore50 - System.Globalization (>= 4.0) - framework: dnxcore50 - System.IO (>= 4.0) - framework: dnxcore50 - System.Linq (>= 4.0) - framework: dnxcore50 - System.ObjectModel (>= 4.0) - framework: dnxcore50 - System.Reflection (>= 4.0) - framework: dnxcore50 - System.Reflection.Emit (>= 4.0) - framework: dnxcore50 - System.Reflection.Extensions (>= 4.0) - framework: dnxcore50 - System.Reflection.Primitives (>= 4.0) - framework: dnxcore50 - System.Reflection.TypeExtensions (>= 4.0) - framework: dnxcore50 - System.Resources.ResourceManager (>= 4.0) - framework: dnxcore50 - System.Runtime (>= 4.0) - framework: dnxcore50 - System.Runtime (>= 4.0.20) - framework: dnxcore50 - System.Runtime.Extensions (>= 4.0) - framework: dnxcore50 - System.Threading (>= 4.0) - framework: dnxcore50 - System.ObjectModel (4.0.10) - framework: dnxcore50 - System.Collections (>= 4.0.10) - framework: dnxcore50 - System.Diagnostics.Debug (>= 4.0.10) - framework: dnxcore50 - System.Resources.ResourceManager (>= 4.0) - framework: dnxcore50 - System.Runtime (>= 4.0.20) - framework: dnxcore50 - System.Threading (>= 4.0.10) - framework: dnxcore50 - System.Private.Uri (4.0) - framework: dnxcore50 - System.Reflection (4.0.10) - framework: dnxcore50 - System.IO (>= 4.0) - framework: dnxcore50 - System.Reflection.Primitives (>= 4.0) - framework: dnxcore50 - System.Runtime (>= 4.0.20) - framework: dnxcore50 - System.Reflection.Emit (4.0) - framework: dnxcore50 - System.IO (>= 4.0) - framework: dnxcore50 - System.Reflection (>= 4.0) - framework: dnxcore50 - System.Reflection.Emit.ILGeneration (>= 4.0) - framework: dnxcore50 - System.Reflection.Primitives (>= 4.0) - framework: dnxcore50 - System.Runtime (>= 4.0) - framework: dnxcore50 - System.Reflection.Emit.ILGeneration (4.0) - framework: dnxcore50 - System.Reflection (>= 4.0) - framework: dnxcore50 - System.Reflection.Primitives (>= 4.0) - framework: dnxcore50 - System.Runtime (>= 4.0) - framework: dnxcore50 - System.Reflection.Extensions (4.0) - framework: dnxcore50 - System.Diagnostics.Debug (>= 4.0.10) - framework: dnxcore50 - System.Reflection (>= 4.0) - framework: dnxcore50 - System.Reflection (>= 4.0.10) - framework: dnxcore50 - System.Reflection.Primitives (>= 4.0) - framework: dnxcore50 - System.Reflection.TypeExtensions (>= 4.0) - framework: dnxcore50 - System.Resources.ResourceManager (>= 4.0) - framework: dnxcore50 - System.Runtime (>= 4.0) - framework: dnxcore50 - System.Runtime (>= 4.0.20) - framework: dnxcore50 - System.Runtime.Extensions (>= 4.0.10) - framework: dnxcore50 - System.Reflection.Primitives (4.0) - framework: dnxcore50 - System.Runtime (>= 4.0) - framework: dnxcore50 - System.Threading (>= 4.0) - framework: dnxcore50 - System.Reflection.TypeExtensions (4.0) - framework: dnxcore50 - System.Diagnostics.Contracts (>= 4.0) - framework: dnxcore50 - System.Diagnostics.Debug (>= 4.0.10) - framework: dnxcore50 - System.Linq (>= 4.0) - framework: dnxcore50 - System.Reflection (>= 4.0) - framework: dnxcore50 - System.Reflection (>= 4.0.10) - framework: dnxcore50 - System.Reflection.Primitives (>= 4.0) - framework: dnxcore50 - System.Resources.ResourceManager (>= 4.0) - framework: dnxcore50 - System.Runtime (>= 4.0) - framework: dnxcore50 - System.Runtime (>= 4.0.20) - framework: dnxcore50 - System.Runtime.Extensions (>= 4.0.10) - framework: dnxcore50 - System.Resources.ResourceManager (4.0) - framework: dnxcore50 - System.Globalization (>= 4.0) - framework: dnxcore50 - System.Reflection (>= 4.0) - framework: dnxcore50 - System.Reflection (>= 4.0.10) - framework: dnxcore50 - System.Runtime (>= 4.0) - framework: dnxcore50 - System.Runtime (>= 4.0.20) - framework: dnxcore50 - System.Runtime (4.0.20) - framework: dnxcore50 - System.Private.Uri (>= 4.0) - framework: dnxcore50 - System.Runtime.Extensions (4.0.10) - framework: dnxcore50 - System.Runtime (>= 4.0.20) - framework: dnxcore50 - System.Text.Encoding (4.0.10) - framework: dnxcore50 - System.Runtime (>= 4.0) - framework: dnxcore50 - System.Text.Encoding.Extensions (4.0.10) - framework: dnxcore50 - System.Runtime (>= 4.0) - framework: dnxcore50 - System.Text.Encoding (>= 4.0.10) - framework: dnxcore50 - System.Text.RegularExpressions (4.0.10) - framework: dnxcore50 - System.Collections (>= 4.0.10) - framework: dnxcore50 - System.Globalization (>= 4.0.10) - framework: dnxcore50 - System.Resources.ResourceManager (>= 4.0) - framework: dnxcore50 - System.Runtime (>= 4.0.20) - framework: dnxcore50 - System.Runtime.Extensions (>= 4.0.10) - framework: dnxcore50 - System.Threading (>= 4.0.10) - framework: dnxcore50 - System.Threading (4.0.10) - framework: dnxcore50 - System.Runtime (>= 4.0) - framework: dnxcore50 - System.Threading.Tasks (>= 4.0) - framework: dnxcore50 - System.Threading.Tasks (4.0.10) - framework: dnxcore50 - System.Runtime (>= 4.0) - framework: dnxcore50 - xunit.abstractions (2.0) - framework: >= net45, dnx451, dnxcore50, monoandroid, monotouch, xamarinios, winv4.5, wpv8.0, wpav8.1 - xunit.assert (2.1) - System.Collections (>= 4.0) - framework: dnxcore50 - System.Diagnostics.Debug (>= 4.0) - framework: dnxcore50 - System.Globalization (>= 4.0) - framework: dnxcore50 - System.Linq (>= 4.0) - framework: dnxcore50 - System.ObjectModel (>= 4.0) - framework: dnxcore50 - System.Reflection (>= 4.0) - framework: dnxcore50 - System.Reflection.Extensions (>= 4.0) - framework: dnxcore50 - System.Runtime (>= 4.0) - framework: dnxcore50 - System.Runtime.Extensions (>= 4.0) - framework: dnxcore50 - System.Text.RegularExpressions (>= 4.0) - framework: dnxcore50 - System.Threading.Tasks (>= 4.0) - framework: dnxcore50 - xunit.extensibility.core (2.1) - framework: >= net45, dnx451, dnxcore50, monoandroid, monotouch, xamarinios, winv4.5, wpv8.0, wpav8.1 - xunit.abstractions (2.0) - xunit.extensibility.execution (2.1) - System.Collections (>= 4.0) - framework: dnxcore50 - System.Diagnostics.Debug (>= 4.0) - framework: dnxcore50 - System.Globalization (>= 4.0) - framework: dnxcore50 - System.IO (>= 4.0) - framework: dnxcore50 - System.Linq (>= 4.0) - framework: dnxcore50 - System.Linq.Expressions (>= 4.0) - framework: dnxcore50 - System.Reflection (>= 4.0) - framework: dnxcore50 - System.Reflection.Extensions (>= 4.0) - framework: dnxcore50 - System.Runtime (>= 4.0) - framework: dnxcore50 - System.Runtime.Extensions (>= 4.0) - framework: dnxcore50 - System.Text.Encoding (>= 4.0) - framework: dnxcore50 - System.Threading (>= 4.0) - framework: dnxcore50 - System.Threading.Tasks (>= 4.0) - framework: dnxcore50 - xunit.abstractions (>= 2.0) - framework: dnxcore50 - xunit.extensibility.core (2.1) - framework: >= net45, dnx451, dnxcore50, monoandroid, monotouch, xamarinios, winv4.5, wpv8.0, wpav8.1 - xunit.runner.console (2.1) + gtk-sharp3 (3.22) + Microsoft.NETCore.Platforms (1.1) - restriction: || (&& (< net35) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net35) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (< net35) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (< net45) (>= netstandard1.1) (< netstandard1.2) (< monoandroid) (< win8)) (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.2) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (< netstandard1.2) (>= netstandard1.5) (< monoandroid)) (&& (< net45) (>= netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net45) (< netstandard1.3) (>= netstandard1.5) (< monoandroid)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (< net451) (>= netstandard1.2) (< monotouch) (< xamarinios) (< xamarinmac) (< win81) (< wpa81)) (&& (< net452) (>= netstandard1.1)) (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (< net46) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (>= dnxcore50) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.2)) (&& (>= dnxcore50) (>= netstandard1.3)) (&& (>= dnxcore50) (>= netstandard1.5)) (>= netstandard1.6) + Microsoft.NETCore.Targets (1.1) - restriction: || (&& (< net35) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net35) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (< net35) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (< net45) (>= netstandard1.1) (< netstandard1.2) (< monoandroid) (< win8)) (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.2) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (< netstandard1.2) (>= netstandard1.5) (< monoandroid)) (&& (< net45) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net45) (< netstandard1.3) (>= netstandard1.5) (< monoandroid)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (< net451) (>= netstandard1.2) (< monotouch) (< xamarinios) (< xamarinmac) (< win81) (< wpa81)) (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (< net46) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (>= dnxcore50) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.2)) (&& (>= dnxcore50) (>= netstandard1.3)) (&& (>= dnxcore50) (>= netstandard1.5)) (&& (>= dnxcore50) (>= netstandard1.6)) (&& (< netstandard1.1) (>= netstandard1.6) (< monoandroid)) (&& (< netstandard1.2) (>= netstandard1.6) (< monoandroid)) (&& (< netstandard1.3) (>= netstandard1.6) (< monoandroid)) (&& (< netstandard1.5) (>= netstandard1.6) (< monoandroid)) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) (>= netcore1.1) + Microsoft.Win32.Primitives (4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net452) (>= netstandard1.3)) (>= netstandard1.6) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + Microsoft.NETCore.Targets (>= 1.1) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + Mono.Cecil (0.10.0-beta6) + System.Collections (>= 4.0.11) - restriction: && (< net35) (>= netstandard1.3) + System.IO.FileSystem (>= 4.0.1) - restriction: && (< net35) (>= netstandard1.3) + System.IO.FileSystem.Primitives (>= 4.0.1) - restriction: && (< net35) (>= netstandard1.3) + System.Reflection (>= 4.1) - restriction: && (< net35) (>= netstandard1.3) + System.Runtime.Extensions (>= 4.1) - restriction: && (< net35) (>= netstandard1.3) + System.Security.Cryptography.Algorithms (>= 4.2) - restriction: && (< net35) (>= netstandard1.3) + System.Security.Cryptography.Csp (>= 4.0) - restriction: && (< net35) (>= netstandard1.3) + System.Threading (>= 4.0.11) - restriction: && (< net35) (>= netstandard1.3) + NETStandard.Library (1.6.1) - restriction: || (&& (< net35) (>= netstandard1.1)) (&& (< net452) (>= netstandard1.1)) (>= netstandard1.6) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: >= netstandard1.0 + Microsoft.Win32.Primitives (>= 4.3) - restriction: >= netstandard1.3 + System.AppContext (>= 4.3) - restriction: >= netstandard1.3 + System.Collections (>= 4.3) - restriction: >= netstandard1.0 + System.Collections.Concurrent (>= 4.3) - restriction: >= netstandard1.1 + System.Console (>= 4.3) - restriction: >= netstandard1.3 + System.Diagnostics.Debug (>= 4.3) - restriction: >= netstandard1.0 + System.Diagnostics.Tools (>= 4.3) - restriction: >= netstandard1.0 + System.Diagnostics.Tracing (>= 4.3) - restriction: >= netstandard1.1 + System.Globalization (>= 4.3) - restriction: >= netstandard1.0 + System.Globalization.Calendars (>= 4.3) - restriction: >= netstandard1.3 + System.IO (>= 4.3) - restriction: >= netstandard1.0 + System.IO.Compression (>= 4.3) - restriction: >= netstandard1.1 + System.IO.Compression.ZipFile (>= 4.3) - restriction: >= netstandard1.3 + System.IO.FileSystem (>= 4.3) - restriction: >= netstandard1.3 + System.IO.FileSystem.Primitives (>= 4.3) - restriction: >= netstandard1.3 + System.Linq (>= 4.3) - restriction: >= netstandard1.0 + System.Linq.Expressions (>= 4.3) - restriction: >= netstandard1.0 + System.Net.Http (>= 4.3) - restriction: >= netstandard1.1 + System.Net.Primitives (>= 4.3) - restriction: >= netstandard1.0 + System.Net.Sockets (>= 4.3) - restriction: >= netstandard1.3 + System.ObjectModel (>= 4.3) - restriction: >= netstandard1.0 + System.Reflection (>= 4.3) - restriction: >= netstandard1.0 + System.Reflection.Extensions (>= 4.3) - restriction: >= netstandard1.0 + System.Reflection.Primitives (>= 4.3) - restriction: >= netstandard1.0 + System.Resources.ResourceManager (>= 4.3) - restriction: >= netstandard1.0 + System.Runtime (>= 4.3) - restriction: >= netstandard1.0 + System.Runtime.Extensions (>= 4.3) - restriction: >= netstandard1.0 + System.Runtime.Handles (>= 4.3) - restriction: >= netstandard1.3 + System.Runtime.InteropServices (>= 4.3) - restriction: >= netstandard1.1 + System.Runtime.InteropServices.RuntimeInformation (>= 4.3) - restriction: >= netstandard1.1 + System.Runtime.Numerics (>= 4.3) - restriction: >= netstandard1.1 + System.Security.Cryptography.Algorithms (>= 4.3) - restriction: >= netstandard1.3 + System.Security.Cryptography.Encoding (>= 4.3) - restriction: >= netstandard1.3 + System.Security.Cryptography.Primitives (>= 4.3) - restriction: >= netstandard1.3 + System.Security.Cryptography.X509Certificates (>= 4.3) - restriction: >= netstandard1.3 + System.Text.Encoding (>= 4.3) - restriction: >= netstandard1.0 + System.Text.Encoding.Extensions (>= 4.3) - restriction: >= netstandard1.0 + System.Text.RegularExpressions (>= 4.3) - restriction: >= netstandard1.0 + System.Threading (>= 4.3) - restriction: >= netstandard1.0 + System.Threading.Tasks (>= 4.3) - restriction: >= netstandard1.0 + System.Threading.Timer (>= 4.3) - restriction: >= netstandard1.2 + System.Xml.ReaderWriter (>= 4.3) - restriction: >= netstandard1.0 + System.Xml.XDocument (>= 4.3) - restriction: >= netstandard1.0 + runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - restriction: || (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - restriction: || (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - restriction: || (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + runtime.native.System (4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + Microsoft.NETCore.Platforms (>= 1.1) + Microsoft.NETCore.Targets (>= 1.1) + runtime.native.System.IO.Compression (4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (>= dnxcore50) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.6)) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + Microsoft.NETCore.Platforms (>= 1.1) + Microsoft.NETCore.Targets (>= 1.1) + runtime.native.System.Net.Http (4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + Microsoft.NETCore.Platforms (>= 1.1) + Microsoft.NETCore.Targets (>= 1.1) + runtime.native.System.Security.Cryptography.Apple (4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple (>= 4.3) + runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - restriction: || (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.1) + runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.1) + runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.1) + runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.1) + runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.1) + runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.1) + runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.1) + runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.1) + runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.1) + runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.1) + runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - restriction: || (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - restriction: || (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple (4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - restriction: || (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - restriction: || (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - restriction: || (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - restriction: || (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - restriction: || (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + StyleCop.Analyzers (1.0.2) + System.AppContext (4.3) - restriction: || (&& (< net452) (>= netstandard1.3)) (>= netstandard1.6) + System.Runtime (>= 4.3) - restriction: || (&& (< net46) (>= netstandard1.3) (< netstandard1.6) (< monoandroid)) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Buffers (4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (>= dnxcore50) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.6)) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Diagnostics.Debug (>= 4.3) - restriction: && (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81) + System.Diagnostics.Tracing (>= 4.3) - restriction: && (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81) + System.Resources.ResourceManager (>= 4.3) - restriction: && (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81) + System.Runtime (>= 4.3) - restriction: && (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81) + System.Threading (>= 4.3) - restriction: && (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81) + System.Collections (4.3) - restriction: || (&& (< net35) (>= netstandard1.3)) (&& (< net45) (>= netstandard1.1) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net452) (>= netstandard1.1)) (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (>= dnxcore50) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.3)) (&& (>= dnxcore50) (>= netstandard1.6)) (&& (< netstandard1.3) (>= netstandard1.6)) (>= netstandard1.5) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Collections.Concurrent (4.3) - restriction: || (&& (< net452) (>= netstandard1.1)) (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (>= netstandard1.6) + System.Collections (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Diagnostics.Debug (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Diagnostics.Tracing (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Globalization (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Reflection (>= 4.3) - restriction: && (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81) + System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime.Extensions (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Threading (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Threading.Tasks (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Console (4.3) - restriction: || (&& (< net452) (>= netstandard1.3)) (>= netstandard1.5) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + Microsoft.NETCore.Targets (>= 1.1) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.IO (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Text.Encoding (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Diagnostics.Debug (4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net452) (>= netstandard1.1)) (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (>= dnxcore50) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.3)) (&& (>= dnxcore50) (>= netstandard1.6)) (>= netstandard1.5) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Diagnostics.DiagnosticSource (4.4) - restriction: || (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (&& (>= dnxcore50) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.6)) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Collections (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3)) (&& (< net45) (>= netstandard1.3) (< netcore2.0) (< xamarinmac)) + System.Diagnostics.Debug (>= 4.3) - restriction: && (< net45) (>= netstandard1.3) (< netcore2.0) (< xamarinmac) + System.Diagnostics.Tracing (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3)) (&& (< net45) (>= netstandard1.3) (< netcore2.0) (< xamarinmac)) + System.Reflection (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3)) (&& (< net45) (>= netstandard1.3) (< netcore2.0) (< xamarinmac)) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3)) (&& (< net45) (>= netstandard1.3) (< netcore2.0) (< xamarinmac)) + System.Runtime.Extensions (>= 4.3) - restriction: && (< net45) (>= netstandard1.3) (< netcore2.0) (< xamarinmac) + System.Threading (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3)) (&& (< net45) (>= netstandard1.3) (< netcore2.0) (< xamarinmac)) + System.Diagnostics.Tools (4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net452) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.1)) (>= netstandard1.6) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wp8) (< wpa81)) (>= dnxcore50) + Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wp8) (< wpa81)) (>= dnxcore50) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wp8) (< wpa81)) (>= dnxcore50) + System.Diagnostics.Tracing (4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net452) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.3)) (>= netstandard1.6) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.2) (< monoandroid) (< win8)) (&& (< net45) (>= netstandard1.2) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (>= dnxcore50) + Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.2) (< monoandroid) (< win8)) (&& (< net45) (>= netstandard1.2) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (>= dnxcore50) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.2) (< monoandroid) (< win8)) (&& (< net45) (>= netstandard1.2) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (>= dnxcore50) + System.Globalization (4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net452) (>= netstandard1.1)) (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (>= dnxcore50) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.3)) (&& (>= dnxcore50) (>= netstandard1.6)) (>= netstandard1.5) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Globalization.Calendars (4.3) - restriction: || (&& (< net452) (>= netstandard1.3)) (&& (>= dnxcore50) (>= netstandard1.3)) (>= netstandard1.6) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + Microsoft.NETCore.Targets (>= 1.1) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Globalization (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Globalization.Extensions (4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Globalization (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Resources.ResourceManager (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime.Extensions (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime.InteropServices (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.IO (4.3) - restriction: || (&& (< net35) (>= net463)) (&& (< net35) (>= netstandard1.3) (< netstandard1.4) (< monoandroid)) (&& (< net35) (>= netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net35) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (< net35) (>= netstandard1.4) (< monoandroid)) (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net452) (>= netstandard1.1)) (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (>= dnxcore50) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.3)) (&& (>= dnxcore50) (>= netstandard1.6)) (&& (< netstandard1.3) (>= netstandard1.6) (< monoandroid)) (>= netstandard1.5) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (>= dnxcore50) + Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (>= dnxcore50) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (>= dnxcore50) + System.Text.Encoding (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (>= dnxcore50) + System.Threading.Tasks (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (>= dnxcore50) + System.IO.Compression (4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net452) (>= netstandard1.1)) (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (>= netstandard1.6) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: && (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81) + runtime.native.System (>= 4.3) - restriction: && (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81) + runtime.native.System.IO.Compression (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Buffers (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Collections (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Diagnostics.Debug (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.IO (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime.Extensions (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime.Handles (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime.InteropServices (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Text.Encoding (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Threading (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Threading.Tasks (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.IO.Compression.ZipFile (4.3) - restriction: || (&& (< net452) (>= netstandard1.3)) (>= netstandard1.6) + System.Buffers (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.IO (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.IO.Compression (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.IO.FileSystem (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.IO.FileSystem.Primitives (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Resources.ResourceManager (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime.Extensions (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Text.Encoding (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.IO.FileSystem (4.3) - restriction: || (&& (< net35) (>= netstandard1.3)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net452) (>= netstandard1.3)) (&& (>= dnxcore50) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.3)) (>= netstandard1.6) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + Microsoft.NETCore.Targets (>= 1.1) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.IO (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.IO.FileSystem.Primitives (>= 4.3) - restriction: || (>= net46) (&& (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Runtime (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime.Handles (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Text.Encoding (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Threading.Tasks (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.IO.FileSystem.Primitives (4.3) - restriction: || (&& (< net35) (>= net46)) (&& (< net35) (>= netstandard1.3)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net452) (>= netstandard1.3)) (&& (>= dnxcore50) (>= netstandard1.1)) (>= netstandard1.6) + System.Runtime (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Linq (4.3) - restriction: || (&& (< net452) (>= netstandard1.1)) (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (>= netstandard1.5) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Collections (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.6) (< monoandroid) (< win8) (< wp8) (< wpa81)) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Diagnostics.Debug (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Resources.ResourceManager (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.6) (< monoandroid) (< win8) (< wp8) (< wpa81)) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Runtime.Extensions (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Linq.Expressions (4.3) - restriction: || (&& (< net452) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.6)) (&& (< netstandard1.3) (>= netstandard1.6) (< monoandroid)) (>= netstandard1.5) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Collections (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Diagnostics.Debug (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Globalization (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.IO (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Linq (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.ObjectModel (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + System.Reflection (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Reflection.Emit (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + System.Reflection.Emit.ILGeneration (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Reflection.Emit.Lightweight (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Reflection.Extensions (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Reflection.Primitives (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Reflection.TypeExtensions (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Resources.ResourceManager (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Runtime.Extensions (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Threading (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Linq.Queryable (4.3) - restriction: >= netstandard1.6 + System.Collections (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Diagnostics.Debug (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Linq (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Linq.Expressions (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Reflection (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Reflection.Extensions (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Net.Http (4.3.2) - restriction: || (&& (< net452) (>= netstandard1.1)) (>= netstandard1.6) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + Microsoft.Win32.Primitives (>= 4.3) - restriction: && (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81) + runtime.native.System (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + runtime.native.System.Net.Http (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + System.Collections (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Diagnostics.Debug (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Diagnostics.DiagnosticSource (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Diagnostics.Tracing (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Globalization (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Globalization.Extensions (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + System.IO (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.IO.Compression (>= 4.3) - restriction: && (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81) + System.IO.FileSystem (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + System.Net.Primitives (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Runtime.Extensions (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Runtime.Handles (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Runtime.InteropServices (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Security.Cryptography.Algorithms (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + System.Security.Cryptography.Encoding (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Security.Cryptography.OpenSsl (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + System.Security.Cryptography.Primitives (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + System.Security.Cryptography.X509Certificates (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (>= net46) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Text.Encoding (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Threading (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Threading.Tasks (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Net.Primitives (4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net452) (>= netstandard1.1)) (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (>= dnxcore50) (>= netstandard1.1)) (>= netstandard1.6) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) (&& (>= netstandard1.0) (< netstandard1.1) (< monoandroid) (< win8) (< wp8)) + Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) (&& (>= netstandard1.0) (< netstandard1.1) (< monoandroid) (< win8) (< wp8)) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) (&& (>= netstandard1.0) (< netstandard1.1) (< monoandroid) (< win8) (< wp8)) + System.Runtime.Handles (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Net.Requests (4.3) - restriction: >= netstandard1.6 + Microsoft.NETCore.Platforms (>= 1.1) - restriction: && (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81) + System.Collections (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Diagnostics.Debug (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Diagnostics.Tracing (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Globalization (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.IO (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) (&& (>= netstandard1.0) (< netstandard1.1) (< monoandroid) (< win8) (< wp8)) + System.Net.Http (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Net.Primitives (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) (&& (>= netstandard1.0) (< netstandard1.1) (< monoandroid) (< win8) (< wp8)) + System.Net.WebHeaderCollection (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) (&& (>= netstandard1.0) (< netstandard1.1) (< monoandroid) (< win8) (< wp8)) + System.Threading (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Threading.Tasks (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Net.Sockets (4.3) - restriction: || (&& (< net452) (>= netstandard1.3)) (>= netstandard1.6) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + Microsoft.NETCore.Targets (>= 1.1) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.IO (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Net.Primitives (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Threading.Tasks (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Net.WebHeaderCollection (4.3) - restriction: || (&& (>= dnxcore50) (>= netstandard1.6)) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Collections (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Resources.ResourceManager (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime.Extensions (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.ObjectModel (4.3) - restriction: || (&& (< net452) (>= netstandard1.1)) (>= netstandard1.6) + System.Collections (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Diagnostics.Debug (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Threading (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Reflection (4.3) - restriction: || (&& (< net35) (>= netstandard1.3)) (&& (< net45) (>= netstandard1.1) (< netstandard1.2) (< monoandroid) (< win8)) (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.2) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net452) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.3)) (&& (>= dnxcore50) (>= netstandard1.6)) (&& (< netstandard1.3) (>= netstandard1.6)) (>= netstandard1.5) (&& (>= netstandard1.6) (< monoandroid)) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (>= dnxcore50) + Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (>= dnxcore50) + System.IO (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (>= dnxcore50) + System.Reflection.Primitives (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (>= dnxcore50) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (>= dnxcore50) + System.Reflection.Emit (4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + System.IO (>= 4.3) - restriction: && (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) + System.Reflection (>= 4.3) - restriction: && (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) + System.Reflection.Emit.ILGeneration (>= 4.3) - restriction: && (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) + System.Reflection.Primitives (>= 4.3) - restriction: && (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime (>= 4.3) - restriction: && (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) + System.Reflection.Emit.ILGeneration (4.3) - restriction: || (&& (>= dnxcore50) (>= netstandard1.5)) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Reflection (>= 4.3) - restriction: && (< net45) (>= netstandard1.0) (< monotouch) (< xamarinios) (< xamarinmac) (< wp8) + System.Reflection.Primitives (>= 4.3) - restriction: && (< net45) (>= netstandard1.0) (< monotouch) (< xamarinios) (< xamarinmac) (< wp8) + System.Runtime (>= 4.3) - restriction: && (< net45) (>= netstandard1.0) (< monotouch) (< xamarinios) (< xamarinmac) (< wp8) + System.Reflection.Emit.Lightweight (4.3) - restriction: || (&& (>= dnxcore50) (>= netstandard1.5)) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Reflection (>= 4.3) - restriction: && (< net45) (>= netstandard1.0) (< monotouch) (< xamarinios) (< xamarinmac) (< wp8) + System.Reflection.Emit.ILGeneration (>= 4.3) - restriction: && (< net45) (>= netstandard1.0) (< monotouch) (< xamarinios) (< xamarinmac) (< wp8) + System.Reflection.Primitives (>= 4.3) - restriction: && (< net45) (>= netstandard1.0) (< monotouch) (< xamarinios) (< xamarinmac) (< wp8) + System.Runtime (>= 4.3) - restriction: && (< net45) (>= netstandard1.0) (< monotouch) (< xamarinios) (< xamarinmac) (< wp8) + System.Reflection.Extensions (4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net452) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.6)) (>= netstandard1.5) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wp8) (< wpa81)) (>= dnxcore50) + Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wp8) (< wpa81)) (>= dnxcore50) + System.Reflection (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wp8) (< wpa81)) (>= dnxcore50) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wp8) (< wpa81)) (>= dnxcore50) + System.Reflection.Primitives (4.3) - restriction: || (&& (< net35) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net35) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (< net45) (>= netstandard1.1) (< netstandard1.2) (< monoandroid) (< win8)) (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.2) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (< netstandard1.3) (>= netstandard1.5) (< monoandroid)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (< net452) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.3)) (&& (>= dnxcore50) (>= netstandard1.5)) (>= netstandard1.6) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wp8) (< wpa81)) (>= dnxcore50) + Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wp8) (< wpa81)) (>= dnxcore50) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wp8) (< wpa81)) (>= dnxcore50) + System.Reflection.TypeExtensions (4.3) - restriction: || (>= netstandard1.5) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Reflection (>= 4.3) - restriction: || (&& (< net46) (>= netstandard1.3) (< netstandard1.5) (< monoandroid)) (&& (< net46) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (>= net462) (>= dnxcore50) + System.Runtime (>= 4.3) - restriction: || (&& (< net46) (>= netstandard1.3) (< netstandard1.5) (< monoandroid)) (&& (< net46) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (>= dnxcore50) + System.Resources.ResourceManager (4.3) - restriction: || (&& (< net35) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net452) (>= netstandard1.1)) (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (>= dnxcore50) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.3)) (&& (>= dnxcore50) (>= netstandard1.6)) (>= netstandard1.5) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wp8) (< wpa81)) (>= dnxcore50) + Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wp8) (< wpa81)) (>= dnxcore50) + System.Globalization (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wp8) (< wpa81)) (>= dnxcore50) + System.Reflection (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wp8) (< wpa81)) (>= dnxcore50) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wp8) (< wpa81)) (>= dnxcore50) + System.Runtime (4.3) - restriction: || (&& (< net35) (>= net463)) (&& (< net35) (>= netstandard1.3) (< netstandard1.4) (< monoandroid)) (&& (< net35) (>= netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net35) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (< net35) (>= netstandard1.4) (< monoandroid)) (&& (< net45) (>= netstandard1.1) (< netstandard1.2) (< monoandroid) (< win8)) (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.1) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.2) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net451) (>= netstandard1.2) (< monotouch) (< xamarinios) (< xamarinmac) (< win81) (< wpa81)) (&& (< net452) (>= net462)) (&& (< net452) (>= netstandard1.1)) (&& (< net452) (>= netstandard1.3) (< netstandard1.4) (< monoandroid)) (&& (< net452) (>= netstandard1.3) (< netstandard1.6) (< monoandroid)) (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (< net452) (>= netstandard1.4) (< netstandard1.6) (< monoandroid)) (&& (>= net462) (>= netstandard1.6)) (&& (>= dnxcore50) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.2)) (&& (>= dnxcore50) (>= netstandard1.3)) (&& (>= dnxcore50) (>= netstandard1.6)) (&& (< netstandard1.3) (>= netstandard1.6)) (>= netstandard1.5) (&& (>= netstandard1.6) (< monoandroid)) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.2) (< monoandroid) (< win8) (< wp8)) (&& (< net45) (>= netstandard1.2) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (>= dnxcore50) + Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.2) (< monoandroid) (< win8) (< wp8)) (&& (< net45) (>= netstandard1.2) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (>= dnxcore50) + System.Runtime.Extensions (4.3) - restriction: || (&& (< net35) (>= netstandard1.3)) (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net452) (>= netstandard1.1)) (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (>= dnxcore50) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.3)) (&& (>= dnxcore50) (>= netstandard1.6)) (>= netstandard1.5) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (>= dnxcore50) + Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (>= dnxcore50) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (>= dnxcore50) + System.Runtime.Handles (4.3) - restriction: || (&& (< net35) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (< net45) (>= netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (< net452) (>= netstandard1.3)) (&& (< net452) (>= netstandard1.4) (< monoandroid)) (&& (>= dnxcore50) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.3)) (>= netstandard1.6) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + Microsoft.NETCore.Targets (>= 1.1) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime.InteropServices (4.3) - restriction: || (&& (< net35) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net452) (>= netstandard1.1)) (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (>= dnxcore50) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.3)) (>= netstandard1.6) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.2) (< monoandroid) (< win8)) (&& (< net45) (>= netstandard1.2) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (>= dnxcore50) (>= netcore1.1) + Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.2) (< monoandroid) (< win8)) (&& (< net45) (>= netstandard1.2) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (>= dnxcore50) (>= netcore1.1) + System.Reflection (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.2) (< monoandroid) (< win8)) (&& (< net45) (>= netstandard1.2) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (>= dnxcore50) (>= netcore1.1) + System.Reflection.Primitives (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.2) (< monoandroid) (< win8)) (&& (< net45) (>= netstandard1.2) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (>= dnxcore50) (>= netcore1.1) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.2) (< monoandroid) (< win8)) (&& (< net45) (>= netstandard1.2) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (>= net462) (>= dnxcore50) (>= netcore1.1) + System.Runtime.Handles (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< netstandard1.5) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (>= dnxcore50) (>= netcore1.1) + System.Runtime.InteropServices.RuntimeInformation (4.3) - restriction: || (&& (< net452) (>= netstandard1.1)) (>= netstandard1.6) + runtime.native.System (>= 4.3) - restriction: && (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81) + System.Reflection (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Reflection.Extensions (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime.InteropServices (>= 4.3) - restriction: && (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81) + System.Threading (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime.Numerics (4.3) - restriction: || (&& (< net452) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.3)) (>= netstandard1.6) + System.Globalization (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime.Extensions (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Security.Cryptography.Algorithms (4.3) - restriction: || (&& (< net35) (>= net46)) (&& (< net35) (>= netstandard1.3)) (&& (< net452) (>= net46) (< netstandard1.4)) (&& (< net452) (>= net461)) (&& (< net452) (>= netstandard1.3)) (&& (< net452) (>= netstandard1.4) (< monoandroid)) (&& (>= dnxcore50) (>= netstandard1.3)) (>= netstandard1.6) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + runtime.native.System.Security.Cryptography.Apple (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + System.Collections (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + System.IO (>= 4.3) - restriction: || (&& (< net46) (>= netstandard1.3) (< netstandard1.4) (< monoandroid)) (&& (< net46) (>= netstandard1.4) (< netstandard1.6) (< monoandroid)) (>= net463) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Resources.ResourceManager (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Runtime (>= 4.3) - restriction: || (&& (< net46) (>= netstandard1.3) (< netstandard1.4) (< monoandroid)) (&& (< net46) (>= netstandard1.4) (< netstandard1.6) (< monoandroid)) (>= net463) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Runtime.Extensions (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Runtime.Handles (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Runtime.InteropServices (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Runtime.Numerics (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + System.Security.Cryptography.Encoding (>= 4.3) - restriction: || (>= net463) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Security.Cryptography.Primitives (>= 4.3) - restriction: || (&& (>= net46) (< netstandard1.4)) (&& (< net46) (>= netstandard1.3) (< netstandard1.4) (< monoandroid)) (&& (< net46) (>= netstandard1.4) (< netstandard1.6) (< monoandroid)) (>= net461) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Text.Encoding (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Security.Cryptography.Cng (4.3) - restriction: || (&& (>= dnxcore50) (>= netstandard1.3)) (&& (>= dnxcore50) (>= netstandard1.6)) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (< net46) (>= netstandard1.4)) (>= netstandard1.6) + System.IO (>= 4.3) - restriction: || (&& (< net46) (>= netstandard1.3) (< netstandard1.4)) (&& (< net46) (>= netstandard1.4)) (>= netstandard1.6) + System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (< net46) (>= netstandard1.4)) (>= netstandard1.6) + System.Runtime (>= 4.3) - restriction: || (&& (< net46) (>= netstandard1.3) (< netstandard1.4)) (&& (< net46) (>= netstandard1.4)) (>= netstandard1.6) + System.Runtime.Extensions (>= 4.3) - restriction: || (&& (< net46) (>= netstandard1.4)) (>= netstandard1.6) + System.Runtime.Handles (>= 4.3) - restriction: || (&& (< net46) (>= netstandard1.3) (< netstandard1.4)) (&& (< net46) (>= netstandard1.4)) (>= netstandard1.6) + System.Runtime.InteropServices (>= 4.3) - restriction: || (&& (< net46) (>= netstandard1.4)) (>= netstandard1.6) + System.Security.Cryptography.Algorithms (>= 4.3) - restriction: || (&& (>= net46) (< netstandard1.4)) (&& (< net46) (>= netstandard1.3) (< netstandard1.4)) (&& (< net46) (>= netstandard1.4)) (>= net461) (>= netstandard1.6) + System.Security.Cryptography.Encoding (>= 4.3) - restriction: || (&& (< net46) (>= netstandard1.4)) (>= netstandard1.6) + System.Security.Cryptography.Primitives (>= 4.3) - restriction: || (&& (>= net46) (< netstandard1.4)) (&& (< net46) (>= netstandard1.3) (< netstandard1.4)) (&& (< net46) (>= netstandard1.4)) (>= net461) (>= netstandard1.6) + System.Text.Encoding (>= 4.3) - restriction: || (&& (< net46) (>= netstandard1.4)) (>= netstandard1.6) + System.Security.Cryptography.Csp (4.3) - restriction: || (&& (< net35) (>= netstandard1.3)) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.IO (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Reflection (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Resources.ResourceManager (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime.Extensions (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime.Handles (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime.InteropServices (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Security.Cryptography.Algorithms (>= 4.3) - restriction: || (>= net46) (&& (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Security.Cryptography.Encoding (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Security.Cryptography.Primitives (>= 4.3) - restriction: || (>= net46) (&& (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Text.Encoding (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Threading (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Security.Cryptography.Encoding (4.3) - restriction: || (&& (< net35) (>= net463)) (&& (< net35) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (< net45) (>= netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net452) (>= net46) (< netstandard1.4)) (&& (< net452) (>= net461)) (&& (< net452) (>= netstandard1.3)) (&& (< net452) (>= netstandard1.4) (< monoandroid)) (&& (>= dnxcore50) (>= netstandard1.3)) (>= netstandard1.6) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Collections (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Collections.Concurrent (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Linq (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Resources.ResourceManager (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime.Extensions (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime.Handles (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime.InteropServices (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Security.Cryptography.Primitives (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Text.Encoding (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Security.Cryptography.OpenSsl (4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) - restriction: || (>= net463) (>= netstandard1.6) (>= monoandroid) + System.Collections (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + System.IO (>= 4.3) - restriction: || (>= net463) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Resources.ResourceManager (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime (>= 4.3) - restriction: || (>= net463) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Runtime.Extensions (>= 4.3) - restriction: || (>= net463) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Runtime.Handles (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime.InteropServices (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime.Numerics (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + System.Security.Cryptography.Algorithms (>= 4.3) - restriction: || (>= net463) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Security.Cryptography.Encoding (>= 4.3) - restriction: || (>= net463) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Security.Cryptography.Primitives (>= 4.3) - restriction: || (>= net463) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Text.Encoding (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + System.Security.Cryptography.Primitives (4.3) - restriction: || (&& (< net35) (>= net46)) (&& (< net35) (>= net461)) (&& (< net35) (>= netstandard1.3) (< netstandard1.4) (< monoandroid)) (&& (< net35) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (< net35) (>= netstandard1.4) (< monoandroid)) (&& (< net452) (>= netstandard1.3)) (&& (>= dnxcore50) (>= netstandard1.3)) (>= netstandard1.6) + System.Diagnostics.Debug (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Globalization (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.IO (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Resources.ResourceManager (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Threading (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Threading.Tasks (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Security.Cryptography.X509Certificates (4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net452) (>= net46)) (&& (< net452) (>= netstandard1.3)) (&& (>= dnxcore50) (>= netstandard1.1)) (>= netstandard1.6) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + runtime.native.System (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + runtime.native.System.Net.Http (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + System.Collections (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Diagnostics.Debug (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + System.Globalization (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Globalization.Calendars (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.IO (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.IO.FileSystem (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.IO.FileSystem.Primitives (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + System.Resources.ResourceManager (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Runtime (>= 4.3) - restriction: || (&& (< net46) (>= netstandard1.3) (< netstandard1.4) (< monoandroid)) (&& (< net46) (>= netstandard1.4) (< netstandard1.6) (< monoandroid)) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Runtime.Extensions (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Runtime.Handles (>= 4.3) - restriction: || (&& (< net46) (>= netstandard1.3) (< netstandard1.4) (< monoandroid)) (&& (< net46) (>= netstandard1.4) (< netstandard1.6) (< monoandroid)) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Runtime.InteropServices (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Runtime.Numerics (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Security.Cryptography.Algorithms (>= 4.3) - restriction: || (&& (>= net46) (< netstandard1.4)) (&& (< net46) (>= netstandard1.3) (< netstandard1.4) (< monoandroid)) (&& (< net46) (>= netstandard1.4) (< netstandard1.6) (< monoandroid)) (>= net461) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Security.Cryptography.Cng (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Security.Cryptography.Csp (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + System.Security.Cryptography.Encoding (>= 4.3) - restriction: || (&& (>= net46) (< netstandard1.4)) (&& (< net46) (>= netstandard1.3) (< netstandard1.4) (< monoandroid)) (&& (< net46) (>= netstandard1.4) (< netstandard1.6) (< monoandroid)) (>= net461) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Security.Cryptography.OpenSsl (>= 4.3) - restriction: && (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac) + System.Security.Cryptography.Primitives (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Text.Encoding (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Threading (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Text.Encoding (4.3) - restriction: || (&& (< net35) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net45) (< netstandard1.3) (>= netstandard1.5) (< monoandroid)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (< net452) (>= netstandard1.1)) (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (< net46) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (>= dnxcore50) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.3)) (&& (>= dnxcore50) (>= netstandard1.5)) (>= netstandard1.6) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Text.Encoding.Extensions (4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net452) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.1)) (>= netstandard1.6) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Text.Encoding (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Text.RegularExpressions (4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net452) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.1)) (>= netstandard1.6) + System.Collections (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< netcore1.1) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Globalization (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< netcore1.1) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Resources.ResourceManager (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< netcore1.1) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.6) (< monoandroid) (< win8) (< wpa81)) (>= dnxcore50) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) (>= netcore1.1) + System.Runtime.Extensions (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< netcore1.1) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Threading (>= 4.3) - restriction: || (>= dnxcore50) (&& (>= netstandard1.6) (< netcore1.1) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Threading (4.3) - restriction: || (&& (< net35) (>= netstandard1.3)) (&& (< net45) (>= netstandard1.1) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net452) (>= netstandard1.1)) (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (>= dnxcore50) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.3)) (&& (>= dnxcore50) (>= netstandard1.5)) (>= netstandard1.6) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Threading.Tasks (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Threading.Tasks (4.3) - restriction: || (&& (< net35) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net45) (< netstandard1.3) (>= netstandard1.5) (< monoandroid)) (&& (< net45) (>= netstandard1.5) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (< net452) (>= netstandard1.1)) (&& (< net452) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac)) (&& (>= dnxcore50) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.3)) (&& (>= dnxcore50) (>= netstandard1.5)) (>= netstandard1.6) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Threading.Tasks.Extensions (4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (>= dnxcore50) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.6)) (&& (>= netstandard1.6) (< monotouch) (< xamarinios) (< xamarinmac)) + System.Collections (>= 4.3) - restriction: && (< net45) (>= netstandard1.0) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wp8) (< wpa81) + System.Runtime (>= 4.3) - restriction: && (< net45) (>= netstandard1.0) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wp8) (< wpa81) + System.Threading.Tasks (>= 4.3) - restriction: && (< net45) (>= netstandard1.0) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wp8) (< wpa81) + System.Threading.Tasks.Parallel (4.3) - restriction: >= netstandard1.6 + System.Collections.Concurrent (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Diagnostics.Debug (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Diagnostics.Tracing (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime.Extensions (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Threading (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Threading.Tasks (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Threading.Thread (4.3) - restriction: >= netstandard1.6 + System.Runtime (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Threading.ThreadPool (4.3) - restriction: >= netstandard1.6 + System.Runtime (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Runtime.Handles (>= 4.3) - restriction: && (< net46) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) + System.Threading.Timer (4.3) - restriction: || (&& (< net452) (>= netstandard1.2)) (>= netstandard1.6) + Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (< net451) (>= netstandard1.2) (< monotouch) (< xamarinios) (< xamarinmac) (< win81) (< wpa81)) (>= dnxcore50) + Microsoft.NETCore.Targets (>= 1.1) - restriction: || (&& (< net451) (>= netstandard1.2) (< monotouch) (< xamarinios) (< xamarinmac) (< win81) (< wpa81)) (>= dnxcore50) + System.Runtime (>= 4.3) - restriction: || (&& (< net451) (>= netstandard1.2) (< monotouch) (< xamarinios) (< xamarinmac) (< win81) (< wpa81)) (>= dnxcore50) + System.Xml.ReaderWriter (4.3) - restriction: || (&& (< net45) (>= netstandard1.1) (< netstandard1.3) (< monoandroid) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (&& (< net452) (>= netstandard1.1)) (&& (>= dnxcore50) (>= netstandard1.1)) (>= netstandard1.6) + System.Collections (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Diagnostics.Debug (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Globalization (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.IO (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.IO.FileSystem (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.IO.FileSystem.Primitives (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime.Extensions (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime.InteropServices (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Text.Encoding (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Text.Encoding.Extensions (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Text.RegularExpressions (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Threading.Tasks (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Threading.Tasks.Extensions (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Xml.XDocument (4.3) - restriction: || (&& (< net452) (>= netstandard1.1)) (>= netstandard1.6) + System.Collections (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Diagnostics.Debug (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Diagnostics.Tools (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Globalization (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.IO (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Reflection (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Runtime.Extensions (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Text.Encoding (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Threading (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + System.Xml.ReaderWriter (>= 4.3) - restriction: || (&& (< net45) (>= netstandard1.0) (< netstandard1.3) (< monoandroid) (< win8) (< wp8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< monotouch) (< xamarinios) (< xamarinmac) (< win8) (< wpa81)) (>= dnxcore50) + xunit.abstractions (2.0.1) - restriction: >= netstandard1.1 + NETStandard.Library (>= 1.6) - restriction: && (< net35) (>= netstandard1.0) + xunit.assert (2.2) + NETStandard.Library (>= 1.6) - restriction: && (< net452) (>= netstandard1.1) + xunit.core (2.2) - restriction: >= netstandard1.6 + xunit.extensibility.core (2.2) + xunit.extensibility.execution (2.2) + xunit.extensibility.core (2.2) - restriction: >= netstandard1.1 + NETStandard.Library (>= 1.6) - restriction: && (< net452) (>= netstandard1.1) + xunit.abstractions (>= 2.0.1) - restriction: >= netstandard1.1 + xunit.extensibility.execution (2.2) + NETStandard.Library (>= 1.6) - restriction: && (< net452) (>= netstandard1.1) + xunit.extensibility.core (2.2) - restriction: >= netstandard1.1 + xunit.runner.console (2.2) diff --git a/src/Generator.Bind/BindStreamWriter.cs b/src/Generator.Bind/BindStreamWriter.cs index 985447d2..d279f145 100644 --- a/src/Generator.Bind/BindStreamWriter.cs +++ b/src/Generator.Bind/BindStreamWriter.cs @@ -1,12 +1,11 @@ -#region License -// +// // The Open Toolkit Library License // // Copyright (c) 2006 - 2013 Stefanos Apostolopoulos for the Open Toolkit Library // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights to +// in the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: @@ -24,31 +23,25 @@ // OTHER DEALINGS IN THE SOFTWARE. // - -#endregion - using System; using System.IO; -using System.Text.RegularExpressions; -using Bind.Structures; -using Enum=Bind.Structures.Enum; namespace Bind { - enum WriteOptions + internal enum WriteOptions { Default = 0, NoIndent = 1 } - class BindStreamWriter : IDisposable + internal class BindStreamWriter : IDisposable { - static readonly string[] SplitStrings = new string[] { System.Environment.NewLine }; - readonly StreamWriter sw; + private static readonly string[] SplitStrings = new string[] { System.Environment.NewLine }; + private readonly StreamWriter sw; public readonly string File; - bool newline = true; - int indent_level = 0; + private bool newline = true; + private int indent_level = 0; public BindStreamWriter(string file) { @@ -64,9 +57,11 @@ namespace Bind public void Unindent() { if (indent_level > 0) + { --indent_level; + } } - + public void Write(WriteOptions options, string value) { var lines = value.Split(SplitStrings, StringSplitOptions.None); @@ -143,12 +138,14 @@ namespace Bind sw.Close(); } - void WriteIndentations(WriteOptions options) + private void WriteIndentations(WriteOptions options) { if (options != WriteOptions.NoIndent) { for (int i = indent_level; i > 0; i--) + { sw.Write(" "); + } } } diff --git a/src/Generator.Bind/CL/CLGenerator.cs b/src/Generator.Bind/CL/CLGenerator.cs index 42dca49e..79679da5 100644 --- a/src/Generator.Bind/CL/CLGenerator.cs +++ b/src/Generator.Bind/CL/CLGenerator.cs @@ -1,15 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Xml.XPath; -using Bind.GL2; -using Bind.Structures; -using Delegate=Bind.Structures.Delegate; -using Enum=Bind.Structures.Enum; - namespace Bind.CL { - class CLGenerator : ES.ESGenerator + internal class CLGenerator : ES.ESGenerator { public CLGenerator(Settings settings) : base(settings) diff --git a/src/Generator.Bind/CSharpSpecWriter.cs b/src/Generator.Bind/CSharpSpecWriter.cs index 5b91f28b..42a59f07 100644 --- a/src/Generator.Bind/CSharpSpecWriter.cs +++ b/src/Generator.Bind/CSharpSpecWriter.cs @@ -1,12 +1,11 @@ -#region License -// +// // The Open Toolkit Library License // // Copyright (c) 2006 - 2010 the Open Toolkit library. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights to +// in the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: @@ -23,7 +22,6 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. // -#endregion using System; using System.Collections.Generic; @@ -39,12 +37,10 @@ namespace Bind using Enum = Bind.Structures.Enum; using Type = Bind.Structures.Type; - sealed class CSharpSpecWriter + internal sealed class CSharpSpecWriter { - IBind Generator { get; set; } - Settings Settings { get { return Generator.Settings; } } - - #region ISpecWriter Members + private IBind Generator { get; set; } + private Settings Settings { get { return Generator.Settings; } } public void WriteBindings(IBind generator) { @@ -52,28 +48,26 @@ namespace Bind WriteBindings(generator.Delegates, generator.Wrappers, generator.Enums); } - #endregion - - #region Private Members - private static void ConsoleRewrite(string text) { int left = Console.CursorLeft; int top = Console.CursorTop; Console.Write(text); for (int i = text.Length; i < 80; i++) + { Console.Write(" "); + } Console.WriteLine(); Console.SetCursorPosition(left, top); } - #region WriteBindings - - void WriteBindings(DelegateCollection delegates, FunctionCollection wrappers, EnumCollection enums) + private void WriteBindings(DelegateCollection delegates, FunctionCollection wrappers, EnumCollection enums) { Console.WriteLine("Writing bindings to {0}", Settings.OutputPath); if (!Directory.Exists(Settings.OutputPath)) + { Directory.CreateDirectory(Settings.OutputPath); + } string temp_enums_file = Path.GetTempFileName(); string temp_wrappers_file = Path.GetTempFileName(); @@ -94,7 +88,9 @@ namespace Bind sw.WriteLine("static partial class {0}", Settings.OutputClass); } else + { sw.WriteLine("namespace {0}", Settings.EnumsOutput); + } sw.WriteLine("{"); @@ -134,20 +130,28 @@ namespace Bind string output_core = Path.Combine(Settings.OutputPath, Settings.ImportsFile); string output_wrappers = Path.Combine(Settings.OutputPath, Settings.WrappersFile); - if (File.Exists(output_enums)) File.Delete(output_enums); - if (File.Exists(output_delegates)) File.Delete(output_delegates); - if (File.Exists(output_core)) File.Delete(output_core); - if (File.Exists(output_wrappers)) File.Delete(output_wrappers); + if (File.Exists(output_enums)) + { + File.Delete(output_enums); + } + if (File.Exists(output_delegates)) + { + File.Delete(output_delegates); + } + if (File.Exists(output_core)) + { + File.Delete(output_core); + } + if (File.Exists(output_wrappers)) + { + File.Delete(output_wrappers); + } File.Move(temp_enums_file, output_enums); File.Move(temp_wrappers_file, output_wrappers); } - #endregion - - #region WriteWrappers - - void WriteWrappers(BindStreamWriter sw, FunctionCollection wrappers, + private void WriteWrappers(BindStreamWriter sw, FunctionCollection wrappers, DelegateCollection delegates, EnumCollection enums, IDictionary CSTypes) { @@ -163,7 +167,7 @@ namespace Bind sw.WriteLine("partial class {0}", Settings.OutputClass); sw.WriteLine("{"); sw.Indent(); - + // Write constructor sw.WriteLine("static {0}()", Settings.OutputClass); sw.WriteLine("{"); @@ -248,7 +252,7 @@ namespace Bind { sw.WriteLine("[Slot({0})]", d.Slot); sw.WriteLine("[DllImport(Library, ExactSpelling = true, CallingConvention = CallingConvention.Winapi)]"); - sw.WriteLine("static extern {0};", GetDeclarationString(d, false)); + sw.WriteLine("private static extern {0};", GetDeclarationString(d, false)); current_signature++; } @@ -258,7 +262,7 @@ namespace Bind Console.WriteLine("Wrote {0} wrappers for {1} signatures", current_wrapper, current_signature); } - void WriteWrapper(BindStreamWriter sw, Function f, EnumCollection enums) + private void WriteWrapper(BindStreamWriter sw, Function f, EnumCollection enums) { if ((Settings.Compatibility & Settings.Legacy.NoDocumentation) == 0) { @@ -287,10 +291,10 @@ namespace Bind sw.WriteLine("[CLSCompliant(false)]"); } - sw.WriteLine("public static {0} {{ throw new NotImplementedException(); }}", GetDeclarationString(f, Settings.Compatibility)); + sw.WriteLine("public static {0} {{ throw new BindingsNotRewrittenException(); }}", GetDeclarationString(f, Settings.Compatibility)); } - void WriteDocumentation(BindStreamWriter sw, Function f) + private void WriteDocumentation(BindStreamWriter sw, Function f) { var docs = f.Documentation; @@ -310,9 +314,13 @@ namespace Bind else if (!String.IsNullOrEmpty(f.Version)) { if (f.Category.StartsWith("VERSION")) + { category = String.Format("[requires: {0}]", "v" + f.Version); + } else + { category = String.Format("[requires: {0}]", "v" + f.Version + " or " + f.Category); + } } // Write function summary @@ -372,7 +380,7 @@ namespace Bind } if (!String.IsNullOrEmpty(docparam.Documentation)) { - sw.WriteLine(WriteOptions.NoIndent, " "); + sw.WriteLine(WriteOptions.NoIndent, ""); sw.WriteLine("/// {0}", docparam.Documentation); sw.WriteLine("/// "); } @@ -395,13 +403,9 @@ namespace Bind catch (Exception e) { Console.WriteLine("[Warning] Error documenting function {0}: {1}", f.WrappedDelegate.Name, e.ToString()); - } + } } - #endregion - - #region WriteTypes - public void WriteTypes(BindStreamWriter sw, Dictionary CSTypes) { sw.WriteLine(); @@ -411,11 +415,7 @@ namespace Bind } } - #endregion - - #region WriteConstants - - void WriteConstants(BindStreamWriter sw, IEnumerable constants) + private void WriteConstants(BindStreamWriter sw, IEnumerable constants) { // Make sure everything is sorted. This will avoid random changes between // consecutive runs of the program. @@ -435,24 +435,26 @@ namespace Bind sw.Write(str); if (!String.IsNullOrEmpty(str)) + { sw.WriteLine(","); + } } } - #endregion - - #region WriteEnums - - void WriteEnums(BindStreamWriter sw, EnumCollection enums, FunctionCollection wrappers) + private void WriteEnums(BindStreamWriter sw, EnumCollection enums, FunctionCollection wrappers) { //sw.WriteLine("#pragma warning disable 3019"); // CLSCompliant attribute //sw.WriteLine("#pragma warning disable 1591"); // Missing doc comments //sw.WriteLine(); if ((Settings.Compatibility & Settings.Legacy.NestedEnums) != Settings.Legacy.None) + { Trace.WriteLine(String.Format("Writing enums to:\t{0}.{1}.{2}", Settings.OutputNamespace, Settings.OutputClass, Settings.NestedEnumsClass)); + } else + { Trace.WriteLine(String.Format("Writing enums to:\t{0}", Settings.EnumsOutput)); + } if ((Settings.Compatibility & Settings.Legacy.ConstIntEnums) == Settings.Legacy.None) { @@ -506,11 +508,17 @@ namespace Bind } if (@enum.IsObsolete) + { sw.WriteLine("[Obsolete(\"{0}\")]", @enum.Obsolete); + } if (!@enum.CLSCompliant) + { sw.WriteLine("[CLSCompliant(false)]"); + } if (@enum.IsFlagCollection) + { sw.WriteLine("[Flags]"); + } sw.WriteLine("public enum " + @enum.Name + " : " + @enum.Type); sw.WriteLine("{"); sw.Indent(); @@ -548,29 +556,24 @@ namespace Bind } } - #endregion - - #region WriteLicense - public void WriteLicense(BindStreamWriter sw) { sw.WriteLine(File.ReadAllText(Path.Combine(Settings.InputPath, Settings.LicenseFile))); sw.WriteLine(); } - #endregion - // For example, if parameter foo has indirection level = 1, then it // is consumed as 'foo*' in the fixed_statements and the call string. - readonly static string[] pointer_levels = new string[] { "", "*", "**", "***", "****" }; - readonly static string[] array_levels = new string[] { "", "[]", "[,]", "[,,]", "[,,,]" }; + private readonly static string[] pointer_levels = new string[] { "", "*", "**", "***", "****" }; - static bool IsEnum(string s, EnumCollection enums) + private readonly static string[] array_levels = new string[] { "", "[]", "[,]", "[,,]", "[,,,]" }; + + private static bool IsEnum(string s, EnumCollection enums) { return enums.ContainsKey(s); } - string GetDeclarationString(Constant c) + private string GetDeclarationString(Constant c) { if (String.IsNullOrEmpty(c.Name)) { @@ -586,13 +589,15 @@ namespace Bind c.Value); } - string GetDeclarationString(Delegate d, bool is_delegate) + private string GetDeclarationString(Delegate d, bool is_delegate) { StringBuilder sb = new StringBuilder(); sb.Append(d.Unsafe ? "unsafe " : ""); if (is_delegate) + { sb.Append("delegate "); + } sb.Append(GetDeclarationString(d.ReturnType, Settings.Legacy.ConstIntEnums)); sb.Append(" "); sb.Append(Settings.FunctionPrefix); @@ -602,7 +607,7 @@ namespace Bind return sb.ToString(); } - string GetDeclarationString(Enum e) + private string GetDeclarationString(Enum e) { StringBuilder sb = new StringBuilder(); List constants = new List(e.ConstantCollection.Values); @@ -610,12 +615,16 @@ namespace Bind { int ret = String.Compare(c1.Value, c2.Value); if (ret == 0) + { return String.Compare(c1.Name, c2.Name); + } return ret; }); if (e.IsFlagCollection) + { sb.AppendLine("[Flags]"); + } sb.Append("public enum "); sb.Append(e.Name); sb.Append(" : "); @@ -628,14 +637,16 @@ namespace Bind sb.Append(" "); sb.Append(declaration); if (!String.IsNullOrEmpty(declaration)) + { sb.AppendLine(","); + } } sb.Append("}"); return sb.ToString(); } - string GetDeclarationString(Function f, Settings.Legacy settings) + private string GetDeclarationString(Function f, Settings.Legacy settings) { StringBuilder sb = new StringBuilder(); @@ -651,15 +662,13 @@ namespace Bind if (f.Parameters.HasGenericParameters) { sb.Append("<"); - foreach (Parameter p in f.Parameters) + foreach (Parameter p in f.Parameters.Where(p => p.Generic)) { - if (p.Generic) - { - sb.Append(p.CurrentType); - sb.Append(","); - } + sb.Append(p.CurrentType); + sb.Append(", "); } - sb.Remove(sb.Length - 1, 1); + + sb.Remove(sb.Length - 2, 2); sb.Append(">"); } @@ -668,31 +677,70 @@ namespace Bind if (f.Parameters.HasGenericParameters) { sb.AppendLine(); - foreach (Parameter p in f.Parameters) + foreach (Parameter p in f.Parameters.Where(p => p.Generic)) { - if (p.Generic) - sb.AppendLine(String.Format(" where {0} : struct", p.CurrentType)); + sb.AppendLine(String.Format(" where {0} : struct", p.CurrentType)); } } return sb.ToString(); } - string GetDeclarationString(Parameter p, bool override_unsafe_setting, Settings.Legacy settings) + private string GetDeclarationString(Parameter p, bool override_unsafe_setting, Settings.Legacy settings) { StringBuilder sb = new StringBuilder(); + List attributes = new List(); if (p.Flow == FlowDirection.Out) - sb.Append("[OutAttribute] "); + { + attributes.Add("OutAttribute"); + } else if (p.Flow == FlowDirection.Undefined) - sb.Append("[InAttribute, OutAttribute] "); + { + attributes.Add("InAttribute"); + attributes.Add("OutAttribute"); + } + + if (!String.IsNullOrEmpty(p.ComputeSize)) + { + int count; + if (Int32.TryParse(p.ComputeSize, out count)) + { + attributes.Add(String.Format("CountAttribute(Count = {0})", count)); + } + else + { + if (p.ComputeSize.StartsWith("COMPSIZE")) + { + //remove the compsize hint, just keep comma delimited param names + var len = "COMPSIZE(".Length; + var computed = p.ComputeSize.Substring(len, (p.ComputeSize.Length - len) - 1); + attributes.Add(String.Format("CountAttribute(Computed = \"{0}\")", computed)); + } + else + { + attributes.Add(String.Format("CountAttribute(Parameter = \"{0}\")", p.ComputeSize)); + } + } + } + + if (attributes.Count != 0) + { + sb.Append("["); + sb.Append(string.Join(", ", attributes)); + sb.Append("] "); + } if (p.Reference) { if (p.Flow == FlowDirection.Out) + { sb.Append("out "); + } else + { sb.Append("ref "); + } } if (!override_unsafe_setting && ((Settings.Compatibility & Settings.Legacy.NoPublicUnsafeFunctions) != Settings.Legacy.None)) @@ -719,7 +767,7 @@ namespace Bind return sb.ToString(); } - string GetDeclarationString(ParameterCollection parameters, Settings.Legacy settings) + private string GetDeclarationString(ParameterCollection parameters, Settings.Legacy settings) { StringBuilder sb = new StringBuilder(); @@ -741,7 +789,7 @@ namespace Bind return sb.ToString(); } - string GetDeclarationString(Type type, Settings.Legacy settings) + private string GetDeclarationString(Type type, Settings.Legacy settings) { var t = type.QualifiedType; if ((settings & Settings.Legacy.ConstIntEnums) != 0) @@ -757,7 +805,5 @@ namespace Bind pointer_levels[type.Pointer], array_levels[type.Array]); } - - #endregion } } diff --git a/src/Generator.Bind/DocProcessor.cs b/src/Generator.Bind/DocProcessor.cs index c8d76eef..cb11a802 100644 --- a/src/Generator.Bind/DocProcessor.cs +++ b/src/Generator.Bind/DocProcessor.cs @@ -3,9 +3,7 @@ using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Text; using System.Text.RegularExpressions; -using System.Xml; using System.Xml.Linq; using System.Xml.XPath; @@ -13,32 +11,38 @@ using Bind.Structures; namespace Bind { - class DocProcessor + internal class DocProcessor { - static readonly char[] numbers = "0123456789".ToCharArray(); - static readonly Regex remove_mathml = new Regex( + private static readonly char[] numbers = "0123456789".ToCharArray(); + + private static readonly Regex remove_mathml = new Regex( @"<(mml:math|inlineequation)[^>]*?>(?:.|\n)*?", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.IgnorePatternWhitespace); - static readonly Regex remove_doctype = new Regex( + + private static readonly Regex remove_doctype = new Regex( @"\[]*(\[.*\])?>", RegexOptions.Compiled | RegexOptions.Multiline); - static readonly Regex remove_xmlns = new Regex( + + private static readonly Regex remove_xmlns = new Regex( "xmlns=\".+\"", RegexOptions.Compiled); - readonly Dictionary DocumentationFiles = + private readonly Dictionary DocumentationFiles = new Dictionary(); - readonly Dictionary DocumentationCache = + + private readonly Dictionary DocumentationCache = new Dictionary(); - Documentation Cached; - string LastFile; + private Documentation Cached; + private string LastFile; - IBind Generator { get; set; } - Settings Settings { get { return Generator.Settings; } } + private IBind Generator { get; set; } + private Settings Settings { get { return Generator.Settings; } } public DocProcessor(IBind generator) { if (generator == null) + { throw new ArgumentNullException(); + } Generator = generator; foreach (string file in Directory.GetFiles(Settings.DocPath).Concat( @@ -64,9 +68,13 @@ namespace Bind { var file = Settings.FunctionPrefix + f.WrappedDelegate.Name + ".xml"; if (!DocumentationFiles.ContainsKey(file)) + { file = Settings.FunctionPrefix + f.TrimmedName + ".xml"; + } if (!DocumentationFiles.ContainsKey(file)) + { file = Settings.FunctionPrefix + f.TrimmedName.TrimEnd(numbers) + ".xml"; + } docs = (DocumentationFiles.ContainsKey(file) ? ProcessFile(DocumentationFiles[file], processor) : null) ?? @@ -87,12 +95,14 @@ namespace Bind // found in the comments in the docs. // Todo: Some simple MathML tags do not include comments, find a solution. // Todo: Some files include more than 1 function - find a way to map these extra functions. - Documentation ProcessFile(string file, EnumProcessor processor) + private Documentation ProcessFile(string file, EnumProcessor processor) { string text; if (LastFile == file) + { return Cached; + } LastFile = file; text = File.ReadAllText(file); @@ -148,10 +158,12 @@ namespace Bind } } - Documentation ToInlineDocs(XDocument doc, EnumProcessor enum_processor) + private Documentation ToInlineDocs(XDocument doc, EnumProcessor enum_processor) { if (doc == null || enum_processor == null) + { throw new ArgumentNullException(); + } var no_const_processing = Settings.Legacy.NoAdvancedEnumProcessing | Settings.Legacy.ConstIntEnums; if (!Generator.Settings.IsEnabled(no_const_processing)) @@ -190,8 +202,9 @@ namespace Bind return inline; } - static readonly char[] newline = new char[] { '\n' }; - static string Cleanup(string text) + private static readonly char[] newline = new char[] { '\n' }; + + private static string Cleanup(string text) { return String.Join(" ", text diff --git a/src/Generator.Bind/ES/ES2Generator.cs b/src/Generator.Bind/ES/ES2Generator.cs index 514732ef..6df56130 100644 --- a/src/Generator.Bind/ES/ES2Generator.cs +++ b/src/Generator.Bind/ES/ES2Generator.cs @@ -1,16 +1,10 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Xml.XPath; +using System.IO; using Bind.GL2; -using Bind.Structures; -using Delegate=Bind.Structures.Delegate; -using Enum=Bind.Structures.Enum; namespace Bind.ES { // Generation implementation for OpenGL ES 2.0 and 3.0 - class ES2Generator : Generator + internal class ES2Generator : Generator { public ES2Generator(Settings settings) : base(settings) diff --git a/src/Generator.Bind/ES/ES31Generator.cs b/src/Generator.Bind/ES/ES31Generator.cs index 326e321a..1b1bb725 100644 --- a/src/Generator.Bind/ES/ES31Generator.cs +++ b/src/Generator.Bind/ES/ES31Generator.cs @@ -1,16 +1,10 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Xml.XPath; +using System.IO; using Bind.GL2; -using Bind.Structures; -using Delegate=Bind.Structures.Delegate; -using Enum=Bind.Structures.Enum; namespace Bind.ES { // Generation implementation for OpenGL ES 3.1 - class ES31Generator : Generator + internal class ES31Generator : Generator { public ES31Generator(Settings settings) : base(settings) diff --git a/src/Generator.Bind/ES/ES3Generator.cs b/src/Generator.Bind/ES/ES3Generator.cs index d93304e8..95f3ff19 100644 --- a/src/Generator.Bind/ES/ES3Generator.cs +++ b/src/Generator.Bind/ES/ES3Generator.cs @@ -1,16 +1,10 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Xml.XPath; +using System.IO; using Bind.GL2; -using Bind.Structures; -using Delegate=Bind.Structures.Delegate; -using Enum=Bind.Structures.Enum; namespace Bind.ES { // Generation implementation for OpenGL ES 3.0 - class ES3Generator : Generator + internal class ES3Generator : Generator { public ES3Generator(Settings settings) : base(settings) diff --git a/src/Generator.Bind/ES/ESGenerator.cs b/src/Generator.Bind/ES/ESGenerator.cs index fa472d31..2b15e6a0 100644 --- a/src/Generator.Bind/ES/ESGenerator.cs +++ b/src/Generator.Bind/ES/ESGenerator.cs @@ -1,16 +1,10 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Xml.XPath; +using System.IO; using Bind.GL2; -using Bind.Structures; -using Delegate=Bind.Structures.Delegate; -using Enum=Bind.Structures.Enum; namespace Bind.ES { // Generator implementation for OpenGL ES 1.0 and 1.1 - class ESGenerator : Generator + internal class ESGenerator : Generator { public ESGenerator(Settings settings) : base(settings) diff --git a/src/Generator.Bind/EnumProcessor.cs b/src/Generator.Bind/EnumProcessor.cs index b1f65c93..0fcf6a92 100644 --- a/src/Generator.Bind/EnumProcessor.cs +++ b/src/Generator.Bind/EnumProcessor.cs @@ -1,12 +1,11 @@ -#region License -// +// // The Open Toolkit Library License // // Copyright (c) 2006 - 2010 the Open Toolkit library. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights to +// in the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: @@ -23,12 +22,10 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. // -#endregion using System; using System.Collections.Generic; using System.Globalization; -using System.IO; using System.Linq; using System.Text; using System.Xml.XPath; @@ -37,19 +34,23 @@ using Enum = Bind.Structures.Enum; namespace Bind { - class EnumProcessor + internal class EnumProcessor { - readonly IEnumerable Overrides; + private readonly IEnumerable Overrides; - IBind Generator { get; set; } - Settings Settings { get { return Generator.Settings; } } + private IBind Generator { get; set; } + private Settings Settings { get { return Generator.Settings; } } public EnumProcessor(IBind generator, IEnumerable overrides) { if (generator == null) + { throw new ArgumentNullException("generator"); + } if (overrides == null) + { throw new ArgumentNullException("overrides"); + } Generator = generator; Overrides = overrides; @@ -71,7 +72,9 @@ namespace Bind public static string GetOverridesPath(string apiname, string enumeration) { if (enumeration == null) + { throw new ArgumentNullException("enumeration"); + } var path = new StringBuilder(); path.Append("/signatures/replace"); @@ -87,9 +90,7 @@ namespace Bind return path.ToString(); } - #region Private Members - - EnumCollection ProcessNames(EnumCollection enums, XPathNavigator nav, string apiname) + private EnumCollection ProcessNames(EnumCollection enums, XPathNavigator nav, string apiname) { EnumCollection processed_enums = new EnumCollection(); foreach (var e in enums.Values) @@ -125,7 +126,7 @@ namespace Bind return processed_enums; } - static string ReplaceName(XPathNavigator nav, string apiname, string name) + private static string ReplaceName(XPathNavigator nav, string apiname, string name) { var enum_override = nav.SelectSingleNode(GetOverridesPath(apiname, name)); if (enum_override != null) @@ -139,7 +140,7 @@ namespace Bind return name; } - static bool IsAlreadyProcessed(string name) + private static bool IsAlreadyProcessed(string name) { string extension = Utilities.GetExtension(name, true); bool unprocessed = false; @@ -153,15 +154,21 @@ namespace Bind public string TranslateEnumName(string name) { if (String.IsNullOrEmpty(name)) + { return name; + } if (Utilities.CSharpKeywords.Contains(name)) + { return name; + } if (!IsAlreadyProcessed(name)) { if (Char.IsDigit(name[0])) + { name = Settings.ConstantPrefix + name; + } StringBuilder translator = new StringBuilder(name); @@ -198,11 +205,17 @@ namespace Bind } if (is_after_underscore_or_number) + { char_to_add = Char.ToUpper(c); + } else if (is_previous_uppercase) + { char_to_add = Char.ToLower(c); + } else + { char_to_add = c; + } translator.Append(char_to_add); @@ -210,7 +223,7 @@ namespace Bind is_after_underscore_or_number = false; } - // First letter should always be uppercase in order + // First letter should always be uppercase in order // to conform to .Net style guidelines. translator[0] = Char.ToUpper(translator[0]); @@ -223,13 +236,15 @@ namespace Bind name = translator.ToString(); if (name.StartsWith(Settings.EnumPrefix)) + { name = name.Substring(Settings.EnumPrefix.Length); + } } return name; } - EnumCollection ProcessConstants(EnumCollection enums, XPathNavigator nav, string apiname) + private EnumCollection ProcessConstants(EnumCollection enums, XPathNavigator nav, string apiname) { foreach (var e in enums.Values) { @@ -262,7 +277,7 @@ namespace Bind return enums; } - static void ReplaceConstant(XPathNavigator enum_override, Constant c) + private static void ReplaceConstant(XPathNavigator enum_override, Constant c) { if (enum_override != null) { @@ -286,7 +301,9 @@ namespace Bind public string TranslateConstantName(string s, bool isValue) { if (String.IsNullOrEmpty(s)) + { return s; + } StringBuilder translator = new StringBuilder(s.Length); @@ -306,7 +323,9 @@ namespace Bind bool is_after_digit = false; if (!isValue && Char.IsDigit(s[0])) + { s = Settings.ConstantPrefix + s; + } foreach (char c in s) { @@ -337,7 +356,9 @@ namespace Bind translator[0] = Char.ToUpper(translator[0]); } else + { translator.Append(s); + } } return translator.ToString(); @@ -350,14 +371,20 @@ namespace Bind { // Trim the unsigned or long specifiers used in C constants ('u' or 'ull'). if (value.ToLower().EndsWith("ull")) + { value = value.Substring(0, value.Length - 3); + } if (value.ToLower().EndsWith("u")) + { value = value.Substring(0, value.Length - 1); + } } // Strip the prefix, if any. if (value.StartsWith(Settings.ConstantPrefix)) + { value = value.Substring(Settings.ConstantPrefix.Length); + } return TranslateConstantName(value, IsValue(value)); } @@ -366,7 +393,7 @@ namespace Bind // (e.g. FOG_COORD_ARRAY_TYPE = GL_FOG_COORDINATE_ARRAY_TYPE) // In this case try searching all enums for the correct constant to alias (stupid opengl specs). // This turns every bare alias into a normal alias that is processed afterwards. - static void ResolveBareAlias(Constant c, EnumCollection enums) + private static void ResolveBareAlias(Constant c, EnumCollection enums) { // Constants are considered bare aliases when they don't have a reference and // their values are non-numeric. @@ -387,7 +414,7 @@ namespace Bind // Resolve 'use' tokens by searching and replacing the correct // value from the enum collection. // Tokens that can't be resolved are removed. - static void ResolveAliases(Enum e, EnumCollection enums) + private static void ResolveAliases(Enum e, EnumCollection enums) { // Note that we have the removal must be a separate step, since // we cannot modify a collection while iterating with foreach. @@ -401,7 +428,7 @@ namespace Bind } } - static bool IsValue(string test) + private static bool IsValue(string test) { // Check if the result is a number. long number; @@ -420,7 +447,5 @@ namespace Bind } return is_number; } - - #endregion } } diff --git a/src/Generator.Bind/FuncProcessor.cs b/src/Generator.Bind/FuncProcessor.cs index 72e31227..c5ce9b52 100644 --- a/src/Generator.Bind/FuncProcessor.cs +++ b/src/Generator.Bind/FuncProcessor.cs @@ -1,12 +1,11 @@ -#region License -// +// // The Open Toolkit Library License // // Copyright (c) 2006 - 2013 Stefanos Apostolopoulos for the Open Toolkit library. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights to +// in the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: @@ -23,12 +22,10 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. // -#endregion using System; using System.Collections.Generic; using System.Diagnostics; -using System.IO; using System.Linq; using System.Text; using System.Text.RegularExpressions; @@ -38,33 +35,38 @@ using Delegate = Bind.Structures.Delegate; namespace Bind { - using Enum = Bind.Structures.Enum; using Type = Bind.Structures.Type; - class FuncProcessor + internal class FuncProcessor { - static readonly Regex Endings = new Regex( + private static readonly Regex Endings = new Regex( @"([fd]v?|u?[isb](64)?v?|v|i_v|fi)$", RegexOptions.Compiled); - static readonly Regex EndingsNotToTrim = new Regex( + + private static readonly Regex EndingsNotToTrim = new Regex( "(sh|ib|[tdrey]s|[eE]n[vd]|bled" + "|Attrib|Access|Boolean|Coord|Depth|Feedbacks|Finish|Flag" + "|Groups|IDs|Indexed|Instanced|Pixels|Queries|Status|Tess|Through" + "|Uniforms|Varyings|Weight|Width)$", RegexOptions.Compiled); - static readonly Regex EndingsAddV = new Regex("^0", RegexOptions.Compiled); - readonly IEnumerable Overrides; + private static readonly Regex EndingsAddV = new Regex("^0", RegexOptions.Compiled); - IBind Generator { get; set; } - Settings Settings { get { return Generator.Settings; } } + private readonly IEnumerable Overrides; + + private IBind Generator { get; set; } + private Settings Settings { get { return Generator.Settings; } } public FuncProcessor(IBind generator, IEnumerable overrides) { if (generator == null) + { throw new ArgumentNullException("generator"); + } if (overrides == null) + { throw new ArgumentNullException("overrides"); + } Generator = generator; Overrides = overrides; @@ -141,9 +143,7 @@ namespace Bind return wrappers; } - #region Private Members - - void GenerateDocumentation(FunctionCollection wrappers, + private void GenerateDocumentation(FunctionCollection wrappers, EnumProcessor enum_processor, DocProcessor doc_processor) { foreach (var list in wrappers) @@ -156,14 +156,14 @@ namespace Bind } } - void GenerateAddressTable(DelegateCollection delegates) + private void GenerateAddressTable(DelegateCollection delegates) { // We allocate one slot per entry point. Rules: // - All extensions get a slot // - Core functions get a slot, unless UseDllImports is enabled // - On Windows, core functions with version > 1.1 must be treated as extensions. // This is controlled via the UseWindowsCompatibleGL setting. - // Entry points without a slot are assigned the magic slot index -1. + // Entry points without a slot are assigned the magic slot index -1. // Generator.Rewrite detects this and generates a static DllImport call // instead of a calli instruction for these functions. @@ -189,13 +189,13 @@ namespace Bind } } } - + // When we have a list of overloaded delegates, make sure that // all generated wrappers use the first (original) delegate, not // the overloaded ones. This allows us to reduce the amount // of delegates we need to generate (1 per entry point instead // of 1 per overload), which improves loading times. - static void RemoveOverloadedDelegates(DelegateCollection delegates, FunctionCollection wrappers) + private static void RemoveOverloadedDelegates(DelegateCollection delegates, FunctionCollection wrappers) { foreach (var w in wrappers.Values.SelectMany(w => w)) { @@ -204,7 +204,7 @@ namespace Bind } } - static string GetPath(string apipath, string apiname, string apiversion, string function, string extension) + private static string GetPath(string apipath, string apiname, string apiversion, string function, string extension) { var path = new StringBuilder(); path.Append("/signatures/"); @@ -250,17 +250,17 @@ namespace Bind return path.ToString(); } - static string GetOverloadsPath(string apiname, string apiversion, string function, string extension) + private static string GetOverloadsPath(string apiname, string apiversion, string function, string extension) { return GetPath("overload", apiname, apiversion, function, extension); } - static string GetOverridesPath(string apiname, string apiversion, string function, string extension) + private static string GetOverridesPath(string apiname, string apiversion, string function, string extension) { return GetPath("replace", apiname, apiversion, function, extension); } - void TranslateType(Bind.Structures.Type type, + private void TranslateType(Bind.Structures.Type type, XPathNavigator function_override, XPathNavigator overrides, EnumProcessor enum_processor, EnumCollection enums, string category, string apiname) @@ -353,15 +353,23 @@ namespace Bind { // For consistency - many overrides use string instead of String. if (enum_override.Value == "string") + { type.QualifiedType = "String"; + } else if (enum_override.Value == "StringBuilder") - type.QualifiedType = "StringBuilder"; + { + throw new NotSupportedException("StringBuilder enum overrides are no longer supported"); + } else + { type.CurrentType = enum_override.Value; + } } if (type.CurrentType == "IntPtr" && String.IsNullOrEmpty(type.PreviousType)) + { type.Pointer = 0; + } if (type.Pointer >= 3) { @@ -379,7 +387,7 @@ namespace Bind } } - static string TranslateExtension(string extension) + private static string TranslateExtension(string extension) { extension = extension.ToUpper(); if (extension.Length > 2) @@ -389,12 +397,12 @@ namespace Bind return extension; } - void TranslateExtension(Delegate d) + private void TranslateExtension(Delegate d) { d.Extension = TranslateExtension(d.Extension); } - static string GetTrimmedExtension(string name, string extension) + private static string GetTrimmedExtension(string name, string extension) { // Extensions are always uppercase int index = name.LastIndexOf(extension.ToUpper()); @@ -406,7 +414,7 @@ namespace Bind } // Trims unecessary suffices from the specified OpenGL function name. - static string GetTrimmedName(Delegate d) + private static string GetTrimmedName(Delegate d) { string name = d.Name; string extension = d.Extension; @@ -445,7 +453,7 @@ namespace Bind return trimmed_name; } - static XPathNodeIterator GetFuncOverload(XPathNavigator nav, Delegate d, string apiname, string apiversion) + private static XPathNodeIterator GetFuncOverload(XPathNavigator nav, Delegate d, string apiname, string apiversion) { // Try a few different extension variations that appear in the overrides xml file string[] extensions = { d.Extension, TranslateExtension(d.Extension), d.Extension.ToUpper() }; @@ -457,18 +465,24 @@ namespace Bind string extensionless_name = GetTrimmedExtension(d.Name, ext); function_overload = nav.Select(GetOverloadsPath(apiname, apiversion, d.Name, ext)); if (function_overload.Count != 0) + { break; + } function_overload = nav.Select(GetOverloadsPath(apiname, apiversion, extensionless_name, ext)); if (function_overload.Count != 0) + { break; + } function_overload = nav.Select(GetOverloadsPath(apiname, apiversion, trimmed_name, ext)); if (function_overload.Count != 0) + { break; + } } return function_overload; } - static XPathNavigator GetFuncOverride(XPathNavigator nav, Delegate d, string apiname, string apiversion) + private static XPathNavigator GetFuncOverride(XPathNavigator nav, Delegate d, string apiname, string apiversion) { // Try a few different extension variations that appear in the overrides xml file string[] extensions = { d.Extension, TranslateExtension(d.Extension), d.Extension.ToUpper() }; @@ -491,12 +505,12 @@ namespace Bind return function_override; } - void TrimName(Function f) + private void TrimName(Function f) { f.TrimmedName = GetTrimmedName(f); } - static void ApplyParameterReplacement(Delegate d, XPathNavigator function_override) + private static void ApplyParameterReplacement(Delegate d, XPathNavigator function_override) { if (function_override != null) { @@ -522,9 +536,16 @@ namespace Bind d.Parameters[i].Flow = Parameter.GetFlowDirection((string)node.TypedValue); break; case "count": + d.Parameters[i].ComputeSize = node.Value.Trim(); int count; - if (Int32.TryParse(node.Value, out count)) + if (Int32.TryParse(d.Parameters[i].ComputeSize, out count)) + { d.Parameters[i].ElementCount = count; + } + else + { + d.Parameters[i].ElementCount = 0; + } break; } } @@ -533,7 +554,7 @@ namespace Bind } } - static void ApplyReturnTypeReplacement(Delegate d, XPathNavigator function_override) + private static void ApplyReturnTypeReplacement(Delegate d, XPathNavigator function_override) { if (function_override != null) { @@ -554,7 +575,7 @@ namespace Bind // 3) A generic object or void* (translates to IntPtr) // 4) A GLenum (translates to int on Legacy.Tao or GL.Enums.GLenum otherwise). // Return types must always be CLS-compliant, because .Net does not support overloading on return types. - void TranslateReturnType(Delegate d, + private void TranslateReturnType(Delegate d, XPathNavigator function_override, XPathNavigator nav, EnumProcessor enum_processor, EnumCollection enums, string apiname, string apiversion) @@ -585,10 +606,14 @@ namespace Bind if (d.ReturnType.CurrentType.Contains("GLenum")) { if ((Settings.Compatibility & Settings.Legacy.ConstIntEnums) == Settings.Legacy.None) + { d.ReturnType.QualifiedType = String.Format("{0}{1}{2}", Settings.EnumsOutput, Settings.NamespaceSeparator, Settings.CompleteEnumName); + } else + { d.ReturnType.QualifiedType = "int"; + } } if (d.ReturnType.CurrentType.ToLower().Contains("bool")) @@ -600,7 +625,7 @@ namespace Bind d.ReturnType.CurrentType = GetCLSCompliantType(d.ReturnType); } - Delegate GetCLSCompliantDelegate(Delegate d) + private Delegate GetCLSCompliantDelegate(Delegate d) { Delegate f = new Delegate(d); @@ -614,7 +639,7 @@ namespace Bind return f; } - void TranslateParameters(Delegate d, + private void TranslateParameters(Delegate d, XPathNavigator function_override, XPathNavigator nav, EnumProcessor enum_processor, EnumCollection enums, string apiname, string apiversion) @@ -625,11 +650,29 @@ namespace Bind { TranslateParameter(d.Parameters[i], function_override, nav, enum_processor, enums, d.Category, apiname); if (d.Parameters[i].CurrentType == "UInt16" && d.Name.Contains("LineStipple")) + { d.Parameters[i].WrapperType |= WrapperTypes.UncheckedParameter; + } + + if (function_override != null) + { + XPathNavigator param_override = function_override.SelectSingleNode(String.Format( + "param[@name='{0}' or @index='{1}']", + d.Parameters[i].RawName, + i)); + if (param_override != null) + { + var legacyArrayParameter = param_override.GetAttribute("legacyArrayParameter", String.Empty); + if (!String.IsNullOrEmpty(legacyArrayParameter)) + { + d.Parameters[i].WrapperType |= WrapperTypes.LegacyArrayParameter; + } + } + } } } - void TranslateParameter(Parameter p, + private void TranslateParameter(Parameter p, XPathNavigator function_override, XPathNavigator overrides, EnumProcessor enum_processor, EnumCollection enums, string category, string apiname) @@ -695,14 +738,16 @@ namespace Bind } if (Utilities.CSharpKeywords.Contains(p.Name)) + { p.Name = Settings.KeywordEscapeCharacter + p.Name; + } // This causes problems with bool arrays //if (CurrentType.ToLower().Contains("bool")) // WrapperType = WrapperTypes.BoolParameter; } - void TranslateAttributes(Delegate d, + private void TranslateAttributes(Delegate d, XPathNavigator function_override, XPathNavigator nav, string apiname, string apiversion) { @@ -734,7 +779,7 @@ namespace Bind } } - FunctionCollection CreateWrappers(DelegateCollection delegates, EnumCollection enums) + private FunctionCollection CreateWrappers(DelegateCollection delegates, EnumCollection enums) { var wrappers = new FunctionCollection(); foreach (var d in delegates.Values.SelectMany(v => v)) @@ -769,7 +814,7 @@ namespace Bind return wrappers; } - FunctionCollection CreateCLSCompliantWrappers(FunctionCollection functions, EnumCollection enums) + private FunctionCollection CreateCLSCompliantWrappers(FunctionCollection functions, EnumCollection enums) { // If the function is not CLS-compliant (e.g. it contains unsigned parameters) // we need to create a CLS-Compliant overload. However, we should only do this @@ -795,7 +840,9 @@ namespace Bind { cls.Parameters[i].CurrentType = GetCLSCompliantType(cls.Parameters[i]); if (cls.Parameters[i].CurrentType != f.Parameters[i].CurrentType) + { modified = true; + } } // Only add a cls-compliant overload if we have @@ -810,13 +857,13 @@ namespace Bind return wrappers; } - static FunctionCollection MarkCLSCompliance(FunctionCollection collection) + private static FunctionCollection MarkCLSCompliance(FunctionCollection collection) { //foreach (var w in // (from list in collection // from w1 in list.Value // from w2 in list.Value - // where + // where // w1.TrimmedName == w2.TrimmedName && // w1.Parameters.Count == w2.Parameters.Count && // ParametersDifferOnlyInReference(w1.Parameters, w2.Parameters) @@ -842,21 +889,33 @@ namespace Bind for (k = 0; k < wrappers[i].Parameters.Count; k++) { if (wrappers[i].Parameters[k].CurrentType != wrappers[j].Parameters[k].CurrentType) + { break; + } if (wrappers[i].Parameters[k].DiffersOnlyOnReference(wrappers[j].Parameters[k])) + { if (wrappers[i].Parameters[k].Reference) + { function_i_is_problematic = true; + } else + { function_j_is_problematic = true; + } + } } if (k == wrappers[i].Parameters.Count) { if (function_i_is_problematic) + { must_remove.Add(i); + } if (function_j_is_problematic) + { must_remove.Add(j); + } } } } @@ -876,12 +935,14 @@ namespace Bind return collection; } - string GetCLSCompliantType(Type type) + private string GetCLSCompliantType(Type type) { if (!type.CLSCompliant) { if (type.Pointer != 0 && Settings.Compatibility == Settings.Legacy.Tao) + { return "IntPtr"; + } switch (type.CurrentType) { @@ -905,7 +966,7 @@ namespace Bind return type.CurrentType; } - IEnumerable CreateNormalWrappers(Delegate d, EnumCollection enums) + private IEnumerable CreateNormalWrappers(Delegate d, EnumCollection enums) { Function f = new Function(d); TrimName(f); @@ -917,7 +978,7 @@ namespace Bind } } - IEnumerable CreateConvenienceOverloads(FunctionCollection wrappers) + private IEnumerable CreateConvenienceOverloads(FunctionCollection wrappers) { var convenience_wrappers = new List(); foreach (var d in wrappers.Values.SelectMany(w => w)) @@ -988,7 +1049,7 @@ namespace Bind return convenience_wrappers; } - static Function CreateReturnTypeConvenienceWrapper(Function d) + private static Function CreateReturnTypeConvenienceWrapper(Function d) { var f = new Function(d); f.ReturnType = new Type(f.Parameters.Last()); @@ -1008,7 +1069,7 @@ namespace Bind return f; } - static Function CreateArrayReturnTypeConvenienceWrapper(Function d) + private static Function CreateArrayReturnTypeConvenienceWrapper(Function d) { var f = new Function(d); var p_array = f.Parameters.Last(); @@ -1025,7 +1086,7 @@ namespace Bind return f; } - List GetWrapper(IDictionary> dictionary, WrapperTypes key, Function raw) + private List GetWrapper(IDictionary> dictionary, WrapperTypes key, Function raw) { if (!dictionary.ContainsKey(key)) { @@ -1057,6 +1118,17 @@ namespace Bind // Generics are handled in a second pass. if ((parameter.WrapperType & WrapperTypes.GenericParameter) == 0) { + if ((parameter.WrapperType & WrapperTypes.LegacyArrayParameter) != 0) + { + foreach (var wrapper in GetWrapper(wrappers, WrapperTypes.LegacyArrayParameter, func)) + { + wrapper.Obsolete = "Use out overload instead"; + var p = wrapper.Parameters[i]; + p.Array++; + p.Pointer--; + } + } + if ((parameter.WrapperType & WrapperTypes.ArrayParameter) != 0) { foreach (var wrapper in GetWrapper(wrappers, WrapperTypes.ArrayParameter, func)) @@ -1197,13 +1269,10 @@ namespace Bind var p = wrapper.Parameters[i]; if ((p.WrapperType & WrapperTypes.StringParameter) != 0) { + p.QualifiedType = "String"; if (p.Flow == FlowDirection.Out) { - p.QualifiedType = "StringBuilder"; - } - else - { - p.QualifiedType = "String"; + p.Reference = true; } } @@ -1230,7 +1299,7 @@ namespace Bind } } - static void WrapReturnType(Function func) + private static void WrapReturnType(Function func) { if ((func.ReturnType.WrapperType & WrapperTypes.StringReturnType) != 0) { @@ -1248,7 +1317,5 @@ namespace Bind func.ReturnType.QualifiedType = "bool"; } } - - #endregion } } diff --git a/src/Generator.Bind/GL2/GL2Generator.cs b/src/Generator.Bind/GL2/GL2Generator.cs index 26e0fe92..8682ae48 100644 --- a/src/Generator.Bind/GL2/GL2Generator.cs +++ b/src/Generator.Bind/GL2/GL2Generator.cs @@ -1,4 +1,3 @@ -#region License // // GL2Generator.cs // @@ -25,15 +24,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // -#endregion -using System; using System.IO; namespace Bind.GL2 { - - class GL2Generator : Generator + internal class GL2Generator : Generator { public GL2Generator(Settings settings) : base(settings) diff --git a/src/Generator.Bind/GL2/GL4Generator.cs b/src/Generator.Bind/GL2/GL4Generator.cs index b5130ea1..51c2a683 100644 --- a/src/Generator.Bind/GL2/GL4Generator.cs +++ b/src/Generator.Bind/GL2/GL4Generator.cs @@ -1,4 +1,3 @@ -#region License // // The Open Toolkit Library License // @@ -6,7 +5,7 @@ // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights to +// in the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: @@ -23,17 +22,12 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. // -#endregion -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; namespace Bind.GL2 { - class GL4Generator : Generator + internal class GL4Generator : Generator { public GL4Generator(Settings settings) : base(settings) diff --git a/src/Generator.Bind/GL2/Generator.cs b/src/Generator.Bind/GL2/Generator.cs index 6da30cd5..a4a7f03a 100644 --- a/src/Generator.Bind/GL2/Generator.cs +++ b/src/Generator.Bind/GL2/Generator.cs @@ -1,27 +1,18 @@ -#region --- License --- /* Copyright (c) 2006, 2007 Stefanos Apostolopoulos * See license.txt for license info */ -#endregion using System; using System.Collections.Generic; -using System.Diagnostics; using System.IO; using System.Linq; using System.Text.RegularExpressions; -using System.Xml.XPath; using Bind.Structures; -using Delegate=Bind.Structures.Delegate; -using Enum=Bind.Structures.Enum; -using Type=Bind.Structures.Type; namespace Bind.GL2 { - abstract class Generator : IBind + internal abstract class Generator : IBind { - #region Fields - protected string glTypemap = "GL2/gl.tm"; protected string csTypemap = "csharp.tm"; protected string enumSpec = "GL2/enum.spec"; @@ -56,14 +47,12 @@ namespace Bind.GL2 public Settings Settings { get; protected set; } - #endregion - - #region Constructors - public Generator(Settings settings) { if (settings == null) + { throw new ArgumentNullException("settings"); + } Settings = settings.Clone(); @@ -86,11 +75,7 @@ namespace Bind.GL2 SpecReader = new XmlSpecReader(Settings); } - #endregion - - #region Private Members - - IEnumerable GetFiles(string path) + private IEnumerable GetFiles(string path) { path = Path.Combine(Settings.InputPath, path); if ((File.GetAttributes(path) & FileAttributes.Directory) != 0) @@ -107,10 +92,6 @@ namespace Bind.GL2 } } - #endregion - - #region IBind Members - public DelegateCollection Delegates { get; private set; } public EnumCollection Enums { get; private set; } public FunctionCollection Wrappers { get; private set; } @@ -146,7 +127,5 @@ namespace Bind.GL2 Wrappers = func_processor.Process(enum_processor, doc_processor, Delegates, Enums, Profile, Version); } - - #endregion } } diff --git a/src/Generator.Bind/Generator.Bind.csproj b/src/Generator.Bind/Generator.Bind.csproj index 054c9626..8c937e98 100644 --- a/src/Generator.Bind/Generator.Bind.csproj +++ b/src/Generator.Bind/Generator.Bind.csproj @@ -14,7 +14,7 @@ Grid IE50 false - v3.5 + v4.6.1 Exe @@ -40,12 +40,16 @@ false false true + true + true + ..\..\stylecop.ruleset 285212672 DEBUG;TRACE; + bin\Debug\Bind.xml True 4096 False @@ -53,7 +57,6 @@ False False 4 - AllRules.ruleset full @@ -61,13 +64,13 @@ TRACE; + bin\Release\Bind.xml 4096 True bin\Release\ False False 4 - AllRules.ruleset none @@ -211,7 +214,9 @@ - + + Designer + @@ -238,6 +243,14 @@ Designer + + + stylecop.json + + + stylecop.ruleset + + @@ -262,4 +275,12 @@ + + + True + + + True + + \ No newline at end of file diff --git a/src/Generator.Bind/IBind.cs b/src/Generator.Bind/IBind.cs index 07e5215d..46dadb79 100644 --- a/src/Generator.Bind/IBind.cs +++ b/src/Generator.Bind/IBind.cs @@ -1,15 +1,13 @@ -#region --- License --- -/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos +/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos * See license.txt for license info */ -#endregion using Bind.Structures; using System.Collections.Generic; namespace Bind { - interface IBind + internal interface IBind { DelegateCollection Delegates { get; } EnumCollection Enums { get; } diff --git a/src/Generator.Bind/ISpecReader.cs b/src/Generator.Bind/ISpecReader.cs index 66e8d959..6437f3c6 100644 --- a/src/Generator.Bind/ISpecReader.cs +++ b/src/Generator.Bind/ISpecReader.cs @@ -1,16 +1,13 @@ -#region --- License --- -/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos +/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos * See license.txt for license info */ -#endregion using System.Collections.Generic; -using System.IO; using Bind.Structures; namespace Bind { - interface ISpecReader + internal interface ISpecReader { void ReadDelegates(string file, DelegateCollection delegates, string apiname, string apiversion); void ReadEnums(string file, EnumCollection enums, string apiname, string apiversion); diff --git a/src/Generator.Bind/Main.cs b/src/Generator.Bind/Main.cs index e578ee5b..df8cba25 100644 --- a/src/Generator.Bind/Main.cs +++ b/src/Generator.Bind/Main.cs @@ -1,14 +1,10 @@ -#region --- License --- /* Copyright (c) 2006, 2007 Stefanos Apostolopoulos * See license.txt for license info */ -#endregion using System; using System.Collections.Generic; using System.Diagnostics; -using System.IO; -using System.Linq; using System.Reflection; using System.Security; using System.Text.RegularExpressions; @@ -18,7 +14,7 @@ using Bind.GL2; namespace Bind { - enum GeneratorMode + internal enum GeneratorMode { All = 0, Default = All, @@ -33,13 +29,13 @@ namespace Bind CL10, } - static class MainClass + internal static class MainClass { - static GeneratorMode mode = GeneratorMode.Default; + private static GeneratorMode mode = GeneratorMode.Default; static internal List Generators = new List(); - static Settings Settings = new Settings(); + private static Settings Settings = new Settings(); - static void Main(string[] arguments) + private static void Main(string[] arguments) { Debug.Listeners.Clear(); Debug.Listeners.Add(new TextWriterTraceListener(Console.Out)); @@ -52,7 +48,7 @@ namespace Bind Assembly.GetExecutingAssembly().GetName().Version.ToString()); Console.WriteLine("For comments, bugs and suggestions visit http://github.com/opentk/opentk"); Console.WriteLine(); - + try { var split = new Regex(@"-\w+", RegexOptions.Compiled); @@ -101,7 +97,9 @@ namespace Bind val = val.ToLower(); bool enable = !opt.StartsWith("-"); if (val.StartsWith("+") || val.StartsWith("-")) + { val = val.Substring(1); + } var settings = Settings.Legacy.None; switch (val) @@ -172,11 +170,11 @@ namespace Bind case GeneratorMode.ES10: Generators.Add(new ESGenerator(Settings)); break; - + case GeneratorMode.ES11: Generators.Add(new ESGenerator(Settings)); break; - + case GeneratorMode.ES20: Generators.Add(new ES2Generator(Settings)); break; @@ -192,7 +190,7 @@ namespace Bind case GeneratorMode.CL10: Generators.Add(new CLGenerator(Settings)); break; - + default: Console.WriteLine("Please specify a generator mode (use '-mode:gl2/gl4/es10/es11/es20/es30')"); return; @@ -212,7 +210,7 @@ namespace Bind Console.WriteLine(); Console.WriteLine("Bindings generated in {0} seconds.", ticks / (double)10000000.0); } - + Console.WriteLine(); if (Debugger.IsAttached) { @@ -243,7 +241,7 @@ namespace Bind case "gl3": case "gl4": - mode = GeneratorMode.GL4; + mode = GeneratorMode.GL4; break; case "es10": diff --git a/src/Generator.Bind/Properties/AssemblyInfo.cs b/src/Generator.Bind/Properties/AssemblyInfo.cs index ee12cfb3..16ced826 100644 --- a/src/Generator.Bind/Properties/AssemblyInfo.cs +++ b/src/Generator.Bind/Properties/AssemblyInfo.cs @@ -5,13 +5,18 @@ using System.Reflection; [assembly: AssemblyTitleAttribute("Generator.Bind")] [assembly: AssemblyProductAttribute("OpenTK")] [assembly: AssemblyDescriptionAttribute("A set of fast, low-level C# bindings for OpenGL, OpenGL ES and OpenAL.")] -[assembly: AssemblyVersionAttribute("2.0.0")] -[assembly: AssemblyFileVersionAttribute("2.0.0")] +[assembly: AssemblyVersionAttribute("3.0.0")] +[assembly: AssemblyFileVersionAttribute("3.0.0")] [assembly: CLSCompliantAttribute(true)] [assembly: AssemblyCopyrightAttribute("Copyright (c) 2006 - 2016 Stefanos Apostolopoulos for the Open Toolkit library.")] namespace System { internal static class AssemblyVersionInformation { - internal const string Version = "2.0.0"; - internal const string InformationalVersion = "2.0.0"; + internal const System.String AssemblyTitle = "Generator.Bind"; + internal const System.String AssemblyProduct = "OpenTK"; + internal const System.String AssemblyDescription = "A set of fast, low-level C# bindings for OpenGL, OpenGL ES and OpenAL."; + internal const System.String AssemblyVersion = "3.0.0"; + internal const System.String AssemblyFileVersion = "3.0.0"; + internal const System.Boolean CLSCompliant = true; + internal const System.String AssemblyCopyright = "Copyright (c) 2006 - 2016 Stefanos Apostolopoulos for the Open Toolkit library."; } } diff --git a/src/Generator.Bind/Settings.cs b/src/Generator.Bind/Settings.cs index f5993aaf..4a67c46a 100644 --- a/src/Generator.Bind/Settings.cs +++ b/src/Generator.Bind/Settings.cs @@ -1,8 +1,6 @@ -#region --- License --- /* Copyright (c) 2006, 2007 Stefanos Apostolopoulos * See license.txt for license info */ -#endregion using System; using System.Collections.Generic; @@ -13,18 +11,18 @@ using System.Runtime.Serialization.Formatters.Binary; namespace Bind { [Serializable] - class Settings + internal class Settings { public Settings() { OverridesFiles = new List(); } - public string DefaultInputPath = "../../../Source/Bind/Specifications"; - public string DefaultOutputPath = "../../../Source/OpenTK/Graphics/OpenGL"; + public string DefaultInputPath = "src/Generator.Bind/Specifications"; + public string DefaultOutputPath = "src/OpenTK/Graphics/OpenGL"; public string DefaultOutputNamespace = "OpenTK.Graphics.OpenGL"; - public string DefaultDocPath = "../../../Source/Bind/Specifications/Docs"; - public string DefaultFallbackDocPath = "../../../Source/Bind/Specifications/Docs/GL"; + public string DefaultDocPath = "src/Generator.Bind/Specifications/Docs"; + public string DefaultFallbackDocPath = "src/Generator.Bind/Specifications/Docs/GL"; public string DefaultLicenseFile = "License.txt"; public string DefaultLanguageTypeMapFile = "csharp.tm"; public string DefaultKeywordEscapeCharacter = "@"; @@ -34,10 +32,11 @@ namespace Bind public string DefaultWrappersFile = "GL.cs"; public Legacy DefaultCompatibility = Legacy.NoDropMultipleTokens; - string inputPath, outputPath, outputNamespace, docPath, fallbackDocPath, licenseFile, + private string inputPath, outputPath, outputNamespace, docPath, fallbackDocPath, licenseFile, languageTypeMapFile, keywordEscapeCharacter, importsFile, delegatesFile, enumsFile, wrappersFile; - Nullable compatibility; + + private Nullable compatibility; public string InputPath { get { return inputPath ?? DefaultInputPath; } set { inputPath = value; } } public string OutputPath { get { return outputPath ?? DefaultOutputPath; } set { outputPath = value; } } public string OutputNamespace { get { return outputNamespace ?? DefaultOutputNamespace; } set { outputNamespace = value; } } @@ -74,8 +73,8 @@ namespace Bind normalEnumsClassOverride; } } - - public string AuxEnumsClass + + public string AuxEnumsClass { get { return GLClass + NamespaceSeparator + NestedEnumsClass; } } @@ -85,9 +84,13 @@ namespace Bind get { if ((Compatibility & Legacy.NestedEnums) != Legacy.None) + { return OutputNamespace + NamespaceSeparator + OutputClass + NamespaceSeparator + NestedEnumsClass; + } else + { return String.IsNullOrEmpty(EnumsNamespace) ? OutputNamespace : OutputNamespace + NamespaceSeparator + EnumsNamespace; + } } } @@ -96,14 +99,18 @@ namespace Bind get { if ((Compatibility & Legacy.NestedEnums) != Legacy.None) + { return OutputNamespace + NamespaceSeparator + GLClass + NamespaceSeparator + NestedEnumsClass; + } else + { return OutputNamespace + NamespaceSeparator + EnumsNamespace; + } } } // New enums namespace (don't use a nested class). - public string EnumsNamespace = null;// = "Enums"; + public string EnumsNamespace = null; // = "Enums"; public string DelegatesClass = "Delegates"; public string ImportsClass = "Core"; @@ -198,11 +205,19 @@ namespace Bind /// True if multiple tokens should be dropped (e.g. FooARB, FooEXT and FooSGI). public bool DropMultipleTokens - { - get { return (Compatibility & Legacy.NoDropMultipleTokens) == Legacy.None; } - set { if (value) Compatibility |= Legacy.NoDropMultipleTokens; else Compatibility &= ~Legacy.NoDropMultipleTokens; } + { + get { return (Compatibility & Legacy.NoDropMultipleTokens) == Legacy.None; } + set { if (value) + { + Compatibility |= Legacy.NoDropMultipleTokens; + } + else + { + Compatibility &= ~Legacy.NoDropMultipleTokens; + } + } } - + public string WindowsGDI = "OpenTK.Platform.Windows.API"; public Settings Clone() diff --git a/src/Generator.Bind/Specifications/GL2/overrides.xml b/src/Generator.Bind/Specifications/GL2/overrides.xml index 0eadec05..b57df4a7 100644 --- a/src/Generator.Bind/Specifications/GL2/overrides.xml +++ b/src/Generator.Bind/Specifications/GL2/overrides.xml @@ -17,7 +17,7 @@ ArrayCap - + StringName @@ -160,9 +160,9 @@ BufferPointer - + - + PrimitiveType @@ -185,7 +185,7 @@ DrawBuffersEnum - + PrimitiveType @@ -227,12 +227,6 @@ ShaderParameter - - - - 0 - - @@ -456,7 +450,7 @@ ClearBuffer - + ClearBufferCombined @@ -470,7 +464,7 @@ - + PrimitiveType @@ -493,7 +487,7 @@ - + 3.2 @@ -513,7 +507,7 @@ DrawElementsType - + 3.2 @@ -530,7 +524,7 @@ GetIndexedPName - + 3.2 @@ -587,7 +581,7 @@ - + SamplerParameterName @@ -734,7 +728,7 @@ PackedPointerType - + @@ -760,7 +754,7 @@ GetQueryParam - + TransformFeedbackTarget @@ -924,7 +918,7 @@ BinaryFormat - + @@ -935,7 +929,7 @@ SizedInternalFormat - + PrimitiveType @@ -944,7 +938,7 @@ DrawElementsType - + PrimitiveType @@ -953,31 +947,31 @@ DrawElementsType - + PrimitiveType - + PrimitiveType - + AtomicCounterBufferParameter - + MemoryBarrierFlags - + TextureTarget1d @@ -986,7 +980,7 @@ SizedInternalFormat - + TextureTarget2d @@ -995,7 +989,7 @@ SizedInternalFormat - + TextureTarget3d @@ -1004,7 +998,7 @@ SizedInternalFormat - + @@ -1018,7 +1012,7 @@ PixelFormat - + BufferTarget @@ -1030,7 +1024,7 @@ PixelFormat - + ImageTarget @@ -1039,7 +1033,7 @@ ImageTarget - + DebugSourceControl @@ -1051,7 +1045,7 @@ DebugSeverityControl - + DebugSourceExternal @@ -1063,7 +1057,7 @@ DebugSeverity - + FramebufferTarget @@ -1081,13 +1075,13 @@ FramebufferDefaultParameter - + ImageTarget SizedInternalFormat InternalFormatParameter - + DebugSource @@ -1099,13 +1093,14 @@ DebugSeverity - + ObjectLabelIdentifier + - + ProgramInterface @@ -1114,7 +1109,7 @@ ProgramInterfaceParameter - + ProgramInterface @@ -1125,8 +1120,9 @@ ProgramInterface + - + ProgramInterface @@ -1134,20 +1130,21 @@ ProgramProperty + - + ProgramInterface - + ProgramInterface - + FramebufferTarget @@ -1156,7 +1153,7 @@ FramebufferAttachment - + FramebufferTarget @@ -1165,7 +1162,7 @@ FramebufferAttachment - + PrimitiveType @@ -1180,19 +1177,19 @@ DrawElementsType - + ObjectLabelIdentifier - + DebugSourceExternal - + TextureBufferTarget @@ -1201,7 +1198,7 @@ SizedInternalFormat - + TextureTargetMultisample2d @@ -1210,7 +1207,7 @@ SizedInternalFormat - + TextureTargetMultisample3d @@ -1219,7 +1216,7 @@ SizedInternalFormat - + TextureTarget @@ -1228,13 +1225,13 @@ PixelInternalFormat - + VertexAttribType - + VertexAttribIntegerType @@ -1246,9 +1243,9 @@ VertexAttribDoubleType - + - + PixelFormat @@ -1257,7 +1254,7 @@ PixelType - + PixelFormat @@ -1460,7 +1457,7 @@ AssemblyProgramParameterArb - + NormalPointerType @@ -1533,7 +1530,7 @@ RenderbufferStorage - + FogPointerType @@ -1651,9 +1648,9 @@ VertexAttribParameterArb - + - + @@ -1663,7 +1660,7 @@ WaitSyncFlags - + WaitSyncStatus @@ -1676,13 +1673,13 @@ WaitSyncFlags - + SyncParameterName - + BufferTarget @@ -1692,6 +1689,16 @@ + + + + + + + + + + @@ -1701,34 +1708,27 @@ int - - - - 0 - - - - - 0 - - - - - 0 - - - - - 0 - - - - - 0 - - + + + + + + + + + + + + + + + + + + + @@ -1866,46 +1866,12 @@ BeginMode - - - 0 - - - - - 0 - - - - - 0 - - - - - 0 - - + ProgramParameter - - - 0 - - - - - 0 - - - - - 0 - - StringName @@ -2006,21 +1972,6 @@ ExtDirectStateAccess - - - 0 - - - - - 0 - - - - - 0 - - ExtDrawBuffers2 @@ -2071,16 +2022,6 @@ IbmVertexArrayLists - - - 0 - - - - - 0 - - NvTransformFeedback2 @@ -4986,7 +4927,7 @@ - + @@ -4999,21 +4940,6 @@ BeginMode - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - @@ -5021,8 +4947,25 @@ in + + + + + + + + + + + + + + + + + - + @@ -5114,11 +5057,11 @@ BufferTarget BufferAccessMask - + BufferTarget - + BufferTarget @@ -5128,7 +5071,7 @@ BufferTarget BufferPointer - + QueryTarget @@ -5143,7 +5086,7 @@ GetQueryObjectParam - + TransformFeedbackTarget @@ -5151,7 +5094,7 @@ TransformFeedbackPrimitiveType - + PixelFormat @@ -5164,7 +5107,7 @@ ClearBufferMask BlitFramebufferFilter - + FrontFaceDirection @@ -5172,12 +5115,12 @@ CullFaceMode - + VertexAttribIntegerType - + PrimitiveType @@ -5197,12 +5140,12 @@ PrimitiveType DrawElementsType - + ShaderType - + ShaderBinaryFormat @@ -5212,12 +5155,12 @@ ProgramParameterName - + ActiveAttribType - + ActiveUniformType @@ -5228,7 +5171,7 @@ ActiveUniformBlockParameter - + TransformFeedbackType @@ -5239,24 +5182,24 @@ - ShaderParameter + ShaderParameter ShaderType ShaderPrecision - VertexAttribParameter + VertexAttribParameter - VertexAttribPointerParameter + VertexAttribPointerParameter - + GetProgramParameterName - + TextureUnit @@ -5264,7 +5207,7 @@ TextureTarget - + SamplerParameterName @@ -5300,7 +5243,7 @@ PixelFormat PixelType - + TextureTarget2d @@ -5318,7 +5261,7 @@ TextureTarget3d - + TextureTarget2d @@ -5334,24 +5277,24 @@ TextureTarget3d - + TextureTarget TextureParameterName - - + + TextureTarget - + TextureTarget GetTextureParameterName - + StencilFunction @@ -5372,12 +5315,12 @@ StencilOp StencilOp - + DepthFunction - + BlendEquationMode @@ -5396,17 +5339,17 @@ BlendingFactorSrc BlendingFactorDest - + DrawBufferMode - + StencilFace - + ClearBufferMask @@ -5417,7 +5360,7 @@ ClearBufferCombined - + SyncCondition @@ -5430,22 +5373,22 @@ WaitSyncFlags - + SyncParameterName - + PixelStoreParameter - + FramebufferTarget - + RenderbufferTarget @@ -5458,14 +5401,14 @@ RenderbufferTarget RenderbufferInternalFormat - + FramebufferTarget FramebufferAttachment RenderbufferTarget - + FramebufferTarget @@ -5477,13 +5420,13 @@ FramebufferAttachment TextureTarget3d - + FramebufferErrorCode FramebufferTarget - + FramebufferTarget @@ -5493,13 +5436,13 @@ FramebufferTarget FramebufferAttachment - + RenderbufferTarget RenderbufferParameterName - + FramebufferTarget @@ -5542,7 +5485,7 @@ in - + QueryCounterTarget @@ -5575,46 +5518,59 @@ ObjectLabelIdentifier + ObjectLabelIdentifier - - + + - 0 + - - 0 + + - - 0 + + - - 0 + + + + + bufsize + - - 0 - 0 + + + - - 0 + + - - 0 + + - - 0 + + - - 0 + + - - 0 - - + + + + + + + + + + + + @@ -5625,7 +5581,7 @@ BeginMode - + CullFaceMode @@ -5636,13 +5592,13 @@ CullFaceMode - + BufferTarget BufferUsage - + TextureTarget @@ -5674,13 +5630,6 @@ PixelFormat - - - - 0 - - - @@ -5725,7 +5674,7 @@ - + @@ -5761,12 +5710,12 @@ - + - + @@ -5791,7 +5740,7 @@ - + @@ -5815,12 +5764,12 @@ - + - + @@ -5829,48 +5778,48 @@ - + - + - + - + - + - + - + - + @@ -5885,7 +5834,7 @@ - + @@ -5894,7 +5843,7 @@ - + @@ -5977,7 +5926,7 @@ - + @@ -5997,7 +5946,7 @@ - + @@ -6010,7 +5959,7 @@ - + @@ -6019,13 +5968,13 @@ - + - + @@ -6039,13 +5988,13 @@ - + - + @@ -6089,7 +6038,7 @@ - + @@ -6151,7 +6100,7 @@ - + @@ -6164,11 +6113,11 @@ - + - + @@ -6176,13 +6125,13 @@ - + - + @@ -6200,21 +6149,21 @@ - + - + - + - + @@ -6225,7 +6174,7 @@ - + @@ -6236,7 +6185,7 @@ - + @@ -6279,12 +6228,12 @@ - + - + @@ -6513,7 +6462,7 @@ - + @@ -6523,7 +6472,7 @@ - + @@ -6683,7 +6632,7 @@ - + @@ -7495,4 +7444,40 @@ - + + + + + + in + + + + + + + counterNameLength + + + counterDescLength + + + + + + + queryNameLength + + + + + + + + + + *length + + + + \ No newline at end of file diff --git a/src/Generator.Bind/Specifications/GL2/signatures.xml b/src/Generator.Bind/Specifications/GL2/signatures.xml index f8b51dfd..10f55dea 100644 --- a/src/Generator.Bind/Specifications/GL2/signatures.xml +++ b/src/Generator.Bind/Specifications/GL2/signatures.xml @@ -55,7 +55,29 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -137,6 +159,8 @@ + + @@ -156,6 +180,7 @@ + @@ -359,9 +384,7 @@ - - @@ -423,7 +446,6 @@ - @@ -475,7 +497,14 @@ - + + + + + + + + @@ -583,6 +612,7 @@ + @@ -612,11 +642,6 @@ - - - - - @@ -673,8 +698,6 @@ - - @@ -708,6 +731,10 @@ + + + + @@ -723,6 +750,16 @@ + + + + + + + + + + @@ -1025,6 +1062,10 @@ + + + + @@ -1054,6 +1095,10 @@ + + + + @@ -1130,6 +1175,16 @@ + + + + + + + + + + @@ -1154,6 +1209,7 @@ + @@ -1185,7 +1241,9 @@ + + @@ -1327,6 +1385,7 @@ + @@ -1352,7 +1411,7 @@ - + @@ -1362,6 +1421,12 @@ + + + + + + @@ -1520,6 +1585,14 @@ + + + + + + + + @@ -1645,9 +1718,7 @@ - - @@ -2221,6 +2292,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2298,6 +2401,7 @@ + @@ -2354,6 +2458,11 @@ + + + + + @@ -2610,6 +2719,7 @@ + @@ -2794,6 +2904,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2871,12 +3008,24 @@ + + + + + + + + + + + + @@ -2889,6 +3038,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2966,6 +3140,7 @@ + @@ -3106,6 +3281,14 @@ + + + + + + + + @@ -3448,9 +3631,28 @@ + + + + + + + + + + + + + + + + + + + @@ -3506,6 +3708,9 @@ + + + @@ -3645,11 +3850,15 @@ + + + + @@ -3794,7 +4003,7 @@ - + @@ -3935,7 +4144,7 @@ - + @@ -4177,7 +4386,11 @@ + + + + @@ -4344,6 +4557,7 @@ + @@ -4383,6 +4597,7 @@ + @@ -4395,9 +4610,11 @@ - + + + @@ -4479,6 +4696,7 @@ + @@ -4664,10 +4882,15 @@ + + + + + @@ -4702,6 +4925,12 @@ + + + + + + @@ -4761,7 +4990,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4772,6 +5031,23 @@ + + + + + + + + + + + + + + + + + @@ -4791,6 +5067,7 @@ + @@ -4834,6 +5111,9 @@ + + + @@ -4857,6 +5137,10 @@ + + + + @@ -4874,6 +5158,23 @@ + + + + + + + + + + + + + + + + + @@ -4898,7 +5199,15 @@ + + + + + + + + @@ -4954,6 +5263,15 @@ + + + + + + + + + @@ -5036,13 +5354,11 @@ - - @@ -5111,9 +5427,6 @@ - - - @@ -5137,6 +5450,11 @@ + + + + + @@ -5149,6 +5467,9 @@ + + + @@ -5235,8 +5556,24 @@ + + + + + + + + + + + + + + + + @@ -5255,6 +5592,7 @@ + @@ -5293,6 +5631,7 @@ + @@ -5429,6 +5768,11 @@ + + + + + @@ -5604,6 +5948,22 @@ + + + + + + + + + + + + + + + + @@ -5612,6 +5972,10 @@ + + + + @@ -5659,6 +6023,13 @@ + + + + + + + @@ -5753,7 +6124,7 @@ - + @@ -5774,7 +6145,7 @@ - + @@ -5789,8 +6160,8 @@ - - + + @@ -5977,6 +6348,9 @@ + + + @@ -6254,10 +6628,10 @@ - - - - + + + + @@ -6328,6 +6702,11 @@ + + + + + @@ -6351,6 +6730,7 @@ + @@ -6438,6 +6818,15 @@ + + + + + + + + + @@ -6502,30 +6891,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + @@ -6570,6 +6995,12 @@ + + + + + + @@ -6638,6 +7069,13 @@ + + + + + + + @@ -6737,6 +7175,12 @@ + + + + + + @@ -6763,6 +7207,14 @@ + + + + + + + + @@ -7219,7 +7671,7 @@ - + @@ -7236,6 +7688,21 @@ + + + + + + + + + + + + + + + @@ -7243,6 +7710,10 @@ + + + + @@ -7348,7 +7819,7 @@ - + @@ -7367,6 +7838,7 @@ + @@ -7763,6 +8235,15 @@ + + + + + + + + + @@ -8029,6 +8510,16 @@ + + + + + + + + + + @@ -8300,7 +8791,7 @@ - + @@ -8451,6 +8942,15 @@ + + + + + + + + + @@ -8486,11 +8986,21 @@ + + + + + + + + + + @@ -8541,6 +9051,11 @@ + + + + + @@ -8715,6 +9230,11 @@ + + + + + @@ -8739,6 +9259,11 @@ + + + + + @@ -8813,6 +9338,16 @@ + + + + + + + + + + @@ -9004,6 +9539,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -9157,6 +9724,20 @@ + + + + + + + + + + + + + + @@ -9290,6 +9871,9 @@ + + + @@ -9355,7 +9939,7 @@ - + @@ -9445,6 +10029,10 @@ + + + + @@ -9549,6 +10137,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -9653,6 +10262,15 @@ + + + + + + + + + @@ -9797,6 +10415,11 @@ + + + + + @@ -10085,6 +10708,11 @@ + + + + + @@ -10169,6 +10797,11 @@ + + + + + @@ -10332,6 +10965,15 @@ + + + + + + + + + @@ -10446,6 +11088,12 @@ + + + + + + @@ -10479,6 +11127,15 @@ + + + + + + + + + @@ -10593,6 +11250,12 @@ + + + + + + @@ -10772,7 +11435,7 @@ - + @@ -10797,6 +11460,15 @@ + + + + + + + + + @@ -11016,6 +11688,13 @@ + + + + + + + @@ -11037,6 +11716,13 @@ + + + + + + + @@ -11565,6 +12251,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -11650,6 +12364,12 @@ + + + + + + @@ -11672,7 +12392,7 @@ - + @@ -11687,6 +12407,10 @@ + + + + @@ -11964,6 +12688,12 @@ + + + + + + @@ -11999,6 +12729,12 @@ + + + + + + @@ -12011,6 +12747,17 @@ + + + + + + + + + + + @@ -12251,6 +12998,10 @@ + + + + @@ -12331,6 +13082,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -12467,6 +13257,10 @@ + + + + @@ -12496,6 +13290,10 @@ + + + + @@ -12567,6 +13365,14 @@ + + + + + + + + @@ -12616,6 +13422,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -12651,6 +13488,16 @@ + + + + + + + + + + @@ -12832,7 +13679,7 @@ - + @@ -13095,6 +13942,10 @@ + + + + @@ -13107,6 +13958,12 @@ + + + + + + @@ -13123,6 +13980,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -13131,21 +14085,21 @@ - + - + - + @@ -13154,7 +14108,7 @@ - + @@ -13162,8 +14116,8 @@ - - + + @@ -13177,7 +14131,7 @@ - + @@ -13194,7 +14148,7 @@ - + @@ -13202,7 +14156,7 @@ - + @@ -13210,7 +14164,7 @@ - + @@ -13220,7 +14174,7 @@ - + @@ -13229,9 +14183,9 @@ - + - + @@ -13862,7 +14816,7 @@ - + @@ -13877,42 +14831,57 @@ - + - + - - + + - + + + + + + + + + + + + + + + + - - + + - + @@ -13966,6 +14935,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -14712,6 +15702,18 @@ + + + + + + + + + + + + @@ -14761,6 +15763,17 @@ + + + + + + + + + + + @@ -15037,7 +16050,7 @@ - + @@ -15106,7 +16119,7 @@ - + @@ -15132,7 +16145,7 @@ - + @@ -15148,12 +16161,25 @@ + + + + + + + + + + + + + @@ -15171,7 +16197,7 @@ - + @@ -15187,12 +16213,25 @@ + + + + + + + + + + + + + @@ -15210,7 +16249,7 @@ - + @@ -15238,14 +16277,14 @@ - + - + @@ -15266,7 +16305,7 @@ - + @@ -15283,6 +16322,13 @@ + + + + + + + @@ -15290,6 +16336,13 @@ + + + + + + + @@ -15308,7 +16361,7 @@ - + @@ -15325,6 +16378,13 @@ + + + + + + + @@ -15332,6 +16392,13 @@ + + + + + + + @@ -15350,7 +16417,7 @@ - + @@ -15380,14 +16447,14 @@ - + - + @@ -15410,7 +16477,7 @@ - + @@ -15428,6 +16495,14 @@ + + + + + + + + @@ -15436,6 +16511,13 @@ + + + + + + + @@ -15455,7 +16537,7 @@ - + @@ -15473,6 +16555,14 @@ + + + + + + + + @@ -15481,6 +16571,13 @@ + + + + + + + @@ -15500,7 +16597,7 @@ - + @@ -15532,14 +16629,14 @@ - + - + @@ -15564,7 +16661,7 @@ - + @@ -15583,6 +16680,15 @@ + + + + + + + + + @@ -15592,6 +16698,13 @@ + + + + + + + @@ -15612,7 +16725,7 @@ - + @@ -15631,6 +16744,15 @@ + + + + + + + + + @@ -15640,6 +16762,13 @@ + + + + + + + @@ -15660,7 +16789,7 @@ - + @@ -15701,7 +16830,7 @@ - + @@ -15709,7 +16838,7 @@ - + @@ -15717,7 +16846,7 @@ - + @@ -15733,7 +16862,7 @@ - + @@ -15741,7 +16870,7 @@ - + @@ -15749,7 +16878,7 @@ - + @@ -15765,7 +16894,7 @@ - + @@ -15773,7 +16902,7 @@ - + @@ -15781,7 +16910,7 @@ - + @@ -15797,7 +16926,7 @@ - + @@ -15805,7 +16934,7 @@ - + @@ -15813,7 +16942,7 @@ - + @@ -15829,7 +16958,7 @@ - + @@ -15837,7 +16966,7 @@ - + @@ -15845,7 +16974,7 @@ - + @@ -15861,7 +16990,7 @@ - + @@ -15869,7 +16998,7 @@ - + @@ -15877,7 +17006,7 @@ - + @@ -15893,7 +17022,7 @@ - + @@ -15901,7 +17030,7 @@ - + @@ -15909,7 +17038,7 @@ - + @@ -15925,7 +17054,7 @@ - + @@ -15933,7 +17062,7 @@ - + @@ -15941,7 +17070,7 @@ - + @@ -15957,7 +17086,7 @@ - + @@ -15965,7 +17094,7 @@ - + @@ -15973,7 +17102,7 @@ - + @@ -16080,6 +17209,11 @@ + + + + + @@ -16133,6 +17267,11 @@ + + + + + @@ -16175,6 +17314,10 @@ + + + + @@ -16369,6 +17512,9 @@ + + + @@ -16387,11 +17533,6 @@ - - - - - @@ -16621,6 +17762,12 @@ + + + + + + @@ -16723,6 +17870,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -16746,6 +17918,11 @@ + + + + + @@ -16851,6 +18028,11 @@ + + + + + @@ -17395,7 +18577,7 @@ - + @@ -17470,6 +18652,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -17556,7 +18791,7 @@ - + @@ -17680,7 +18915,7 @@ - + @@ -17864,6 +19099,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -17985,7 +19273,7 @@ - + @@ -18045,11 +19333,22 @@ + + + + + + + + + + + @@ -18067,11 +19366,22 @@ + + + + + + + + + + + @@ -18113,12 +19423,24 @@ + + + + + + + + + + + + @@ -18137,12 +19459,24 @@ + + + + + + + + + + + + @@ -18187,6 +19521,13 @@ + + + + + + + @@ -18194,6 +19535,12 @@ + + + + + + @@ -18213,6 +19560,13 @@ + + + + + + + @@ -18220,6 +19574,12 @@ + + + + + + @@ -18267,6 +19627,14 @@ + + + + + + + + @@ -18275,6 +19643,12 @@ + + + + + + @@ -18295,6 +19669,14 @@ + + + + + + + + @@ -18303,6 +19685,12 @@ + + + + + + @@ -20254,12 +21642,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -20510,6 +21925,12 @@ + + + + + + @@ -20521,7 +21942,432 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -22130,115 +23976,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -22246,79 +23984,14 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -22333,66 +24006,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -22401,141 +24017,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -22559,58 +24043,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -22644,20 +24080,6 @@ - - - - - - - - - - - - - - @@ -24631,6 +26053,22 @@ + + + + + + + + + + + + + + + + @@ -25254,6 +26692,20 @@ + + + + + + + + + + + + + + @@ -25308,6 +26760,12 @@ + + + + + + @@ -25489,7 +26947,7 @@ - + @@ -26363,7 +27821,7 @@ - + @@ -26383,7 +27841,7 @@ - + @@ -26399,7 +27857,7 @@ - + @@ -26412,7 +27870,7 @@ - + @@ -26425,7 +27883,7 @@ - + @@ -26438,7 +27896,7 @@ - + @@ -26452,7 +27910,7 @@ - + @@ -26466,7 +27924,7 @@ - + @@ -26480,7 +27938,7 @@ - + @@ -26494,7 +27952,7 @@ - + @@ -26509,7 +27967,7 @@ - + @@ -26524,7 +27982,7 @@ - + @@ -26539,7 +27997,7 @@ - + @@ -26554,7 +28012,7 @@ - + @@ -26570,7 +28028,7 @@ - + @@ -26586,7 +28044,7 @@ - + @@ -26602,7 +28060,7 @@ - + @@ -26618,7 +28076,7 @@ - + @@ -26626,7 +28084,7 @@ - + @@ -26634,7 +28092,7 @@ - + @@ -26642,7 +28100,7 @@ - + @@ -26650,7 +28108,7 @@ - + @@ -26658,7 +28116,7 @@ - + @@ -26666,7 +28124,7 @@ - + @@ -26674,7 +28132,7 @@ - + @@ -26682,7 +28140,7 @@ - + @@ -26690,7 +28148,7 @@ - + @@ -26698,7 +28156,7 @@ - + @@ -26706,7 +28164,7 @@ - + @@ -26714,7 +28172,7 @@ - + @@ -26722,7 +28180,7 @@ - + @@ -26730,7 +28188,7 @@ - + @@ -26738,7 +28196,7 @@ - + @@ -26746,7 +28204,7 @@ - + @@ -26754,7 +28212,7 @@ - + @@ -26762,7 +28220,7 @@ - + @@ -26881,6 +28339,10 @@ + + + + @@ -27564,14 +29026,14 @@ - + - + @@ -27806,7 +29268,7 @@ - + @@ -27857,7 +29319,7 @@ - + @@ -27866,6 +29328,7 @@ + @@ -27937,7 +29400,7 @@ - + @@ -28032,7 +29495,7 @@ - + @@ -28083,7 +29546,7 @@ - + @@ -28239,6 +29702,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -28365,7 +29856,7 @@ - + @@ -28375,23 +29866,23 @@ - + - - + + - - + + @@ -28478,7 +29969,7 @@ - + @@ -28607,7 +30098,7 @@ - + @@ -28674,6 +30165,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -28686,6 +30238,21 @@ + + + + + + + + + + + + + + + @@ -28769,9 +30336,7 @@ - - @@ -28826,7 +30391,6 @@ - @@ -28834,6 +30398,7 @@ + @@ -28858,7 +30423,14 @@ - + + + + + + + + @@ -28880,6 +30452,7 @@ + @@ -28909,11 +30482,6 @@ - - - - - @@ -28974,6 +30542,28 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -28981,6 +30571,10 @@ + + + + @@ -28996,6 +30590,16 @@ + + + + + + + + + + @@ -29088,6 +30692,9 @@ + + + @@ -29225,6 +30832,10 @@ + + + + @@ -29238,6 +30849,16 @@ + + + + + + + + + + @@ -29314,6 +30935,16 @@ + + + + + + + + + + @@ -29338,6 +30969,7 @@ + @@ -29369,7 +31001,9 @@ + + @@ -29474,6 +31108,7 @@ + @@ -29488,7 +31123,7 @@ - + @@ -29498,6 +31133,12 @@ + + + + + + @@ -29557,6 +31198,16 @@ + + + + + + + + + + @@ -29588,6 +31239,14 @@ + + + + + + + + @@ -29596,6 +31255,9 @@ + + + @@ -29619,6 +31281,7 @@ + @@ -29681,9 +31344,7 @@ - - @@ -29828,6 +31489,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -29889,6 +31582,7 @@ + @@ -29941,6 +31635,11 @@ + + + + + @@ -30016,6 +31715,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -30048,6 +31821,9 @@ + + + @@ -30137,11 +31913,15 @@ + + + + @@ -30238,7 +32018,7 @@ - + @@ -30352,7 +32132,7 @@ - + @@ -30494,6 +32274,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -30535,6 +32341,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -30571,6 +32397,7 @@ + @@ -30610,6 +32437,7 @@ + @@ -30622,9 +32450,11 @@ - + + + @@ -30706,6 +32536,7 @@ + @@ -30871,6 +32702,10 @@ + + + + @@ -30891,6 +32726,444 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -30898,6 +33171,13 @@ + + + + + + + @@ -30943,7 +33223,7 @@ - + @@ -30964,7 +33244,7 @@ - + @@ -30979,8 +33259,8 @@ - - + + @@ -31145,11 +33425,19 @@ + + + + + + + + @@ -31173,6 +33461,7 @@ + @@ -31205,6 +33494,15 @@ + + + + + + + + + @@ -31268,30 +33566,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + @@ -31323,17 +33657,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -31378,10 +33751,20 @@ + + + + + + + + + + @@ -31433,6 +33816,12 @@ + + + + + + @@ -31469,6 +33858,11 @@ + + + + + @@ -31497,10 +33891,17 @@ + + + + + + + - + @@ -31511,6 +33912,10 @@ + + + + @@ -31520,6 +33925,11 @@ + + + + + @@ -31550,19 +33960,38 @@ + + + + + + + + - + + + + + + + + + + + + @@ -31610,6 +34039,10 @@ + + + + @@ -31621,6 +34054,12 @@ + + + + + + @@ -31671,6 +34110,15 @@ + + + + + + + + + @@ -31678,6 +34126,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -31688,6 +34247,17 @@ + + + + + + + + + + + @@ -31700,6 +34270,19 @@ + + + + + + + + + + + + + @@ -31714,6 +34297,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -31816,12 +34424,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -31833,6 +34527,16 @@ + + + + + + + + + + @@ -31844,6 +34548,18 @@ + + + + + + + + + + + + @@ -31856,16 +34572,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -31887,12 +34665,28 @@ + + + + + + + + + + + + + + + + @@ -31984,6 +34778,11 @@ + + + + + @@ -31994,11 +34793,30 @@ + + + + + + + + + + + + + + + + + + + @@ -32009,6 +34827,11 @@ + + + + + @@ -32040,11 +34863,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -32069,6 +34917,13 @@ + + + + + + + @@ -32077,6 +34932,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -32091,6 +34985,14 @@ + + + + + + + + @@ -32119,6 +35021,14 @@ + + + + + + + + @@ -32153,16 +35063,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -32177,7 +35144,33 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -32186,6 +35179,11 @@ + + + + + @@ -32193,6 +35191,20 @@ + + + + + + + + + + + + + + @@ -32218,6 +35230,21 @@ + + + + + + + + + + + + + + + @@ -32226,24 +35253,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -32328,6 +35396,18 @@ + + + + + + + + + + + + @@ -32347,6 +35427,18 @@ + + + + + + + + + + + + @@ -32354,6 +35446,13 @@ + + + + + + + @@ -32386,6 +35485,11 @@ + + + + + @@ -32425,12 +35529,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -32449,6 +35581,12 @@ + + + + + + @@ -32486,11 +35624,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -32507,6 +35676,15 @@ + + + + + + + + + @@ -32533,6 +35711,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -32545,19 +35811,44 @@ + + + + + + + + + + + + + + + + + + - + + + + + + + + @@ -32565,18 +35856,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -32615,6 +35967,11 @@ + + + + + @@ -32725,6 +36082,13 @@ + + + + + + + @@ -32746,6 +36110,13 @@ + + + + + + + @@ -32775,6 +36146,14 @@ + + + + + + + + @@ -32797,6 +36176,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -32829,12 +36388,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -32880,6 +36463,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -32942,9 +36553,13 @@ - + + + + + @@ -32969,6 +36584,10 @@ + + + + @@ -32978,6 +36597,15 @@ + + + + + + + + + @@ -32985,6 +36613,14 @@ + + + + + + + + @@ -32992,35 +36628,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -33067,6 +36744,18 @@ + + + + + + + + + + + + @@ -33080,6 +36769,18 @@ + + + + + + + + + + + + @@ -33094,24 +36795,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -33119,6 +36862,23 @@ + + + + + + + + + + + + + + + + + @@ -33177,6 +36937,19 @@ + + + + + + + + + + + + + @@ -33185,15 +36958,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -33202,6 +37004,10 @@ + + + + @@ -33210,6 +37016,10 @@ + + + + @@ -33218,23 +37028,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -33247,13 +37109,175 @@ + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -33273,22 +37297,39 @@ - + + + + + + + + + + + + + + + + + + - - + + - + @@ -33297,22 +37338,48 @@ - + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -33361,39 +37428,272 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + - + - + - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + @@ -33413,6 +37713,12 @@ + + + + + + @@ -33425,6 +37731,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -33432,6 +37759,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -33440,6 +37807,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -33447,6 +37922,13 @@ + + + + + + + @@ -33455,6 +37937,23 @@ + + + + + + + + + + + + + + + + + @@ -33463,6 +37962,11 @@ + + + + + @@ -33509,15 +38013,214 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -33525,23 +38228,56 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + @@ -33550,11 +38286,24 @@ + + + + + + - + + + + + + + + @@ -33563,11 +38312,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + @@ -33576,11 +38364,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + @@ -33590,11 +38417,25 @@ + + + + + + + - + + + + + + + + @@ -33604,11 +38445,25 @@ + + + + + + + - + + + + + + + + @@ -33618,11 +38473,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + @@ -33632,11 +38529,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + @@ -33647,11 +38586,26 @@ + + + + + + + + - + + + + + + + + @@ -33662,11 +38616,26 @@ + + + + + + + + - + + + + + + + + @@ -33677,11 +38646,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + @@ -33692,11 +38706,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + @@ -33708,11 +38767,27 @@ + + + + + + + + + - + + + + + + + + @@ -33724,11 +38799,27 @@ + + + + + + + + + - + + + + + + + + @@ -33740,11 +38831,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + @@ -33756,11 +38895,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + @@ -33769,6 +38956,12 @@ + + + + + + @@ -33776,12 +38969,27 @@ + + + + + + + - + + + + + + + + + @@ -33789,7 +38997,15 @@ - + + + + + + + + + @@ -33797,7 +39013,15 @@ - + + + + + + + + + @@ -33805,7 +39029,15 @@ - + + + + + + + + + @@ -33813,7 +39045,15 @@ - + + + + + + + + + @@ -33821,7 +39061,15 @@ - + + + + + + + + + @@ -33829,7 +39077,15 @@ - + + + + + + + + + @@ -33837,7 +39093,15 @@ - + + + + + + + + + @@ -33845,7 +39109,15 @@ - + + + + + + + + + @@ -33853,7 +39125,15 @@ - + + + + + + + + + @@ -33861,7 +39141,15 @@ - + + + + + + + + + @@ -33869,7 +39157,15 @@ - + + + + + + + + + @@ -33877,7 +39173,15 @@ - + + + + + + + + + @@ -33885,7 +39189,15 @@ - + + + + + + + + + @@ -33893,7 +39205,15 @@ - + + + + + + + + + @@ -33901,7 +39221,15 @@ - + + + + + + + + + @@ -33909,7 +39237,15 @@ - + + + + + + + + + @@ -33917,13 +39253,38 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -33938,11 +39299,21 @@ + + + + + + + + + + @@ -33994,6 +39365,15 @@ + + + + + + + + + @@ -34002,6 +39382,9 @@ + + + @@ -34065,6 +39448,12 @@ + + + + + + @@ -34075,6 +39464,14 @@ + + + + + + + + @@ -34100,6 +39497,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -34108,6 +39609,12 @@ + + + + + + @@ -34176,7 +39683,7 @@ - + @@ -34225,18 +39732,88 @@ + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -34245,36 +39822,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -34282,6 +39907,14 @@ + + + + + + + + @@ -34290,6 +39923,15 @@ + + + + + + + + + @@ -34299,6 +39941,16 @@ + + + + + + + + + + @@ -34308,6 +39960,16 @@ + + + + + + + + + + @@ -34318,6 +39980,17 @@ + + + + + + + + + + + @@ -34328,6 +40001,17 @@ + + + + + + + + + + + @@ -34340,6 +40024,19 @@ + + + + + + + + + + + + + @@ -34354,6 +40051,21 @@ + + + + + + + + + + + + + + + @@ -34376,7 +40088,14 @@ - + + + + + + + + @@ -34390,6 +40109,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -34402,6 +40165,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -34415,6 +40226,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -34429,6 +40292,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -34440,12 +40359,23 @@ + + + + + + + + + + + @@ -34515,20 +40445,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -34566,11 +40526,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -34588,11 +40698,25 @@ + + + + + + + + + + + + + + @@ -34601,6 +40725,14 @@ + + + + + + + + @@ -34608,6 +40740,13 @@ + + + + + + + @@ -34618,16 +40757,36 @@ + + + + + + + + + + + + + + + + + + + + @@ -34639,6 +40798,28 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -34651,6 +40832,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -34664,6 +40869,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -34671,6 +40902,13 @@ + + + + + + + @@ -34740,6 +40978,12 @@ + + + + + + @@ -34789,15 +41033,217 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -35059,114 +41505,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -35174,77 +41513,14 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -36657,6 +42933,22 @@ + + + + + + + + + + + + + + + + @@ -37275,6 +43567,20 @@ + + + + + + + + + + + + + + @@ -37329,6 +43635,12 @@ + + + + + + @@ -37510,7 +43822,7 @@ - + @@ -38384,7 +44696,7 @@ - + @@ -38404,7 +44716,7 @@ - + @@ -38420,7 +44732,7 @@ - + @@ -38433,7 +44745,7 @@ - + @@ -38446,7 +44758,7 @@ - + @@ -38459,7 +44771,7 @@ - + @@ -38473,7 +44785,7 @@ - + @@ -38487,7 +44799,7 @@ - + @@ -38501,7 +44813,7 @@ - + @@ -38515,7 +44827,7 @@ - + @@ -38530,7 +44842,7 @@ - + @@ -38545,7 +44857,7 @@ - + @@ -38560,7 +44872,7 @@ - + @@ -38575,7 +44887,7 @@ - + @@ -38591,7 +44903,7 @@ - + @@ -38607,7 +44919,7 @@ - + @@ -38623,7 +44935,7 @@ - + @@ -38639,7 +44951,7 @@ - + @@ -38647,7 +44959,7 @@ - + @@ -38655,7 +44967,7 @@ - + @@ -38663,7 +44975,7 @@ - + @@ -38671,7 +44983,7 @@ - + @@ -38679,7 +44991,7 @@ - + @@ -38687,7 +44999,7 @@ - + @@ -38695,7 +45007,7 @@ - + @@ -38703,7 +45015,7 @@ - + @@ -38711,7 +45023,7 @@ - + @@ -38719,7 +45031,7 @@ - + @@ -38727,7 +45039,7 @@ - + @@ -38735,7 +45047,7 @@ - + @@ -38743,7 +45055,7 @@ - + @@ -38751,7 +45063,7 @@ - + @@ -38759,7 +45071,7 @@ - + @@ -38767,7 +45079,7 @@ - + @@ -38775,7 +45087,7 @@ - + @@ -38783,7 +45095,7 @@ - + @@ -38902,6 +45214,10 @@ + + + + @@ -39585,14 +45901,14 @@ - + - + @@ -39827,7 +46143,7 @@ - + @@ -39878,7 +46194,7 @@ - + @@ -39887,6 +46203,7 @@ + @@ -39958,7 +46275,7 @@ - + @@ -40053,7 +46370,7 @@ - + @@ -40104,7 +46421,7 @@ - + @@ -40260,6 +46577,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -40386,7 +46731,7 @@ - + @@ -40396,23 +46741,23 @@ - + - - + + - - + + @@ -40499,7 +46844,7 @@ - + @@ -40628,7 +46973,7 @@ - + @@ -40695,6 +47040,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -40829,6 +47235,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -40906,6 +47344,7 @@ + @@ -40962,6 +47401,11 @@ + + + + + @@ -41173,6 +47617,16 @@ + + + + + + + + + + @@ -41228,6 +47682,9 @@ + + + @@ -41367,11 +47824,15 @@ + + + + @@ -41516,7 +47977,7 @@ - + @@ -41657,7 +48118,7 @@ - + @@ -42113,6 +48574,10 @@ + + + + @@ -42394,7 +48859,7 @@ - + @@ -42415,7 +48880,7 @@ - + @@ -42430,8 +48895,8 @@ - - + + @@ -42661,6 +49126,9 @@ + + + @@ -42669,6 +49137,11 @@ + + + + + @@ -42692,6 +49165,7 @@ + @@ -42741,6 +49215,15 @@ + + + + + + + + + @@ -42805,30 +49288,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + @@ -43929,11 +50448,6 @@ - - - - - @@ -45467,6 +51981,18 @@ + + + + + + + + + + + + @@ -45508,6 +52034,12 @@ + + + + + + @@ -45590,6 +52122,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -45667,6 +52231,7 @@ + @@ -45706,6 +52271,11 @@ + + + + + @@ -45726,6 +52296,11 @@ + + + + + @@ -45849,12 +52424,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -45863,6 +52474,7 @@ + @@ -45955,7 +52567,12 @@ + + + + + @@ -46004,7 +52621,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -46025,9 +52674,17 @@ + + + + + + + + @@ -46036,11 +52693,29 @@ + + + + + + + + + + + + + + + + + + @@ -46051,6 +52726,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -46063,14 +52763,21 @@ + + + + + + + @@ -46078,6 +52785,25 @@ + + + + + + + + + + + + + + + + + + + @@ -46157,10 +52883,25 @@ + + + + + + + + + + + + + + + @@ -46182,9 +52923,27 @@ + + + + + + + + + + + + + + + + + + @@ -46196,6 +52955,12 @@ + + + + + + @@ -46236,6 +53001,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -46294,6 +53084,9 @@ + + + @@ -46433,11 +53226,15 @@ + + + + @@ -46582,7 +53379,7 @@ - + @@ -46723,7 +53520,7 @@ - + @@ -46879,6 +53676,13 @@ + + + + + + + @@ -46905,12 +53709,21 @@ + + + + + + + + + @@ -47064,6 +53877,7 @@ + @@ -47103,6 +53917,7 @@ + @@ -47115,9 +53930,11 @@ - + + + @@ -47199,6 +54016,7 @@ + @@ -47384,6 +54202,11 @@ + + + + + @@ -47404,6 +54227,7 @@ + @@ -47460,6 +54284,28 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -47514,6 +54360,7 @@ + @@ -47539,21 +54386,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -47562,6 +54475,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -47569,6 +54665,19 @@ + + + + + + + + + + + + + @@ -47593,6 +54702,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -47616,6 +54751,7 @@ + @@ -47627,6 +54763,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -47634,16 +54801,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -47655,6 +54860,9 @@ + + + @@ -47682,6 +54890,7 @@ + @@ -47699,6 +54908,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -47707,6 +54966,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -47757,6 +55036,17 @@ + + + + + + + + + + + @@ -47777,6 +55067,13 @@ + + + + + + + @@ -47787,6 +55084,24 @@ + + + + + + + + + + + + + + + + + + @@ -47835,7 +55150,7 @@ - + @@ -47856,7 +55171,7 @@ - + @@ -47871,8 +55186,8 @@ - - + + @@ -48038,9 +55353,16 @@ + + + + + + + @@ -48113,6 +55435,9 @@ + + + @@ -48121,6 +55446,11 @@ + + + + + @@ -48144,6 +55474,7 @@ + @@ -48193,6 +55524,15 @@ + + + + + + + + + @@ -48257,30 +55597,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + @@ -48316,6 +55692,12 @@ + + + + + + @@ -48330,6 +55712,14 @@ + + + + + + + + @@ -48343,6 +55733,19 @@ + + + + + + + + + + + + + @@ -48366,18 +55769,35 @@ + + + + + + + + + + + + + + + + + @@ -48386,6 +55806,14 @@ + + + + + + + + @@ -48417,6 +55845,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -48431,6 +55909,14 @@ + + + + + + + + @@ -48457,6 +55943,11 @@ + + + + + @@ -48483,6 +55974,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -48506,10 +56020,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -48577,6 +56135,16 @@ + + + + + + + + + + @@ -48596,6 +56164,11 @@ + + + + + @@ -48605,6 +56178,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -48614,6 +56211,16 @@ + + + + + + + + + + @@ -48627,6 +56234,14 @@ + + + + + + + + @@ -48657,6 +56272,22 @@ + + + + + + + + + + + + + + + + @@ -48665,6 +56296,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -48681,6 +56349,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -48700,6 +56413,19 @@ + + + + + + + + + + + + + @@ -48811,6 +56537,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -48845,11 +56619,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -48865,6 +56679,11 @@ + + + + + @@ -48876,6 +56695,11 @@ + + + + + @@ -48921,6 +56745,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -48930,6 +56775,14 @@ + + + + + + + + @@ -48941,6 +56794,21 @@ + + + + + + + + + + + + + + + @@ -49040,6 +56908,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -49152,6 +57107,23 @@ + + + + + + + + + + + + + + + + + @@ -49188,12 +57160,30 @@ + + + + + + + + + + + + + + + + + + @@ -49208,12 +57198,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -49221,20 +57241,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -49243,10 +57365,18 @@ + + + + + + + + @@ -49258,6 +57388,23 @@ + + + + + + + + + + + + + + + + + @@ -49270,6 +57417,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -49281,6 +57464,22 @@ + + + + + + + + + + + + + + + + @@ -49289,6 +57488,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -49320,6 +57549,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -49340,6 +57758,17 @@ + + + + + + + + + + + @@ -49353,6 +57782,14 @@ + + + + + + + + @@ -49366,6 +57803,19 @@ + + + + + + + + + + + + + @@ -49379,6 +57829,19 @@ + + + + + + + + + + + + + @@ -49406,6 +57869,20 @@ + + + + + + + + + + + + + + @@ -49420,6 +57897,20 @@ + + + + + + + + + + + + + + @@ -49449,6 +57940,21 @@ + + + + + + + + + + + + + + + @@ -49464,6 +57970,21 @@ + + + + + + + + + + + + + + + @@ -49495,6 +58016,22 @@ + + + + + + + + + + + + + + + + @@ -49511,6 +58048,22 @@ + + + + + + + + + + + + + + + + @@ -49527,6 +58080,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -49623,6 +58202,11 @@ + + + + + @@ -49665,6 +58249,11 @@ + + + + + @@ -49705,6 +58294,9 @@ + + + @@ -49714,12 +58306,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -49728,11 +58370,34 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -49741,6 +58406,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -49751,6 +58493,12 @@ + + + + + + @@ -49759,6 +58507,14 @@ + + + + + + + + @@ -49772,18 +58528,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -49818,6 +58598,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -49859,6 +58692,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -49870,6 +58756,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -49946,12 +58972,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -50647,7 +59745,7 @@ - + @@ -51267,6 +60365,22 @@ + + + + + + + + + + + + + + + + @@ -52417,7 +61531,7 @@ - + @@ -52430,7 +61544,7 @@ - + @@ -52443,7 +61557,7 @@ - + @@ -52457,7 +61571,7 @@ - + @@ -52471,7 +61585,7 @@ - + @@ -52485,7 +61599,7 @@ - + @@ -52500,7 +61614,7 @@ - + @@ -52515,7 +61629,7 @@ - + @@ -52530,7 +61644,7 @@ - + @@ -52546,7 +61660,7 @@ - + @@ -52562,7 +61676,7 @@ - + @@ -52578,7 +61692,7 @@ - + @@ -52586,7 +61700,7 @@ - + @@ -52594,7 +61708,7 @@ - + @@ -52602,7 +61716,7 @@ - + @@ -52610,7 +61724,7 @@ - + @@ -52618,7 +61732,7 @@ - + @@ -52626,7 +61740,7 @@ - + @@ -52634,7 +61748,7 @@ - + @@ -52642,7 +61756,7 @@ - + @@ -52650,7 +61764,7 @@ - + @@ -52703,4 +61817,1465 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Generator.Bind/Specifications/License.txt b/src/Generator.Bind/Specifications/License.txt index cad9e383..4151957a 100644 --- a/src/Generator.Bind/Specifications/License.txt +++ b/src/Generator.Bind/Specifications/License.txt @@ -5,7 +5,7 @@ // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights to +// in the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: diff --git a/src/Generator.Bind/Specifications/csharp.tm b/src/Generator.Bind/Specifications/csharp.tm index 0106c1d3..c22e27ec 100644 --- a/src/Generator.Bind/Specifications/csharp.tm +++ b/src/Generator.Bind/Specifications/csharp.tm @@ -111,6 +111,14 @@ GLfixed, int GLeglImageOES, IntPtr +# External egl buffer type added in OpenGL 4.6 +GLeglClientBufferEXT, IntPtr + + +# nVidia vulkan entry point, added by NV_draw_vulkan_image extension +GLVULKANPROCNV, IntPtr + + # OpenCL types. _cl_context, IntPtr _cl_event, IntPtr diff --git a/src/Generator.Bind/Structures/Constant.cs b/src/Generator.Bind/Structures/Constant.cs index a3f891a0..abcbdf8c 100644 --- a/src/Generator.Bind/Structures/Constant.cs +++ b/src/Generator.Bind/Structures/Constant.cs @@ -1,40 +1,25 @@ -#region --- License --- /* Copyright (c) 2006, 2007 Stefanos Apostolopoulos * See license.txt for license info */ -#endregion using System; using System.Diagnostics; using System.Globalization; using System.Linq; -using System.Text; namespace Bind.Structures { /// /// Represents an opengl constant in C# format. Both the constant name and value /// can be retrieved or set. The value can be either a number, another constant - /// or an alias to a constant + /// or an alias to a constant /// - class Constant : IComparable + internal class Constant : IComparable { - #region PreviousName - - string original_name; - // Gets the name prior to translation. - public string OriginalName - { - get { return original_name; } - private set { original_name = value; } - } + public string OriginalName { get; private set; } - #endregion - - #region public string Name - - string _name; + private string _name; /// /// Gets or sets the name of the opengl constant (eg. GL_LINES). @@ -43,23 +28,23 @@ namespace Bind.Structures public string Name { get { return _name; } - set + set { if (String.IsNullOrEmpty(value)) + { throw new ArgumentNullException("value"); + } if (OriginalName == null) + { OriginalName = _name; + } _name = value; } } - #endregion - - #region public string Value - - string _value; + private string _value; /// /// Gets or sets the value of the opengl constant (eg. 0x00000001). @@ -73,34 +58,19 @@ namespace Bind.Structures set { if (String.IsNullOrEmpty(value)) + { throw new ArgumentNullException("value"); + } _value = value; } } - #endregion - - #region public string Reference - - string _reference; - /// /// Gets or sets a string indicating the OpenGL enum reference by this constant. /// Can be null. /// - public string Reference - { - get { return _reference; } - set - { - _reference = value; - } - } - - #endregion - - #region public bool Unchecked + public string Reference { get; set; } public bool Unchecked { @@ -111,14 +81,10 @@ namespace Bind.Structures string test = Value; return UInt64.TryParse(test.ToLower().Replace("0x", String.Empty), NumberStyles.AllowHexSpecifier, null, out number) && - number > Int32.MaxValue; + number > Int32.MaxValue; } } - #endregion - - #region Constructors - /// /// Creates an empty Constant. /// @@ -137,21 +103,22 @@ namespace Bind.Structures Value = value; } - #endregion - /// /// Replces the Value of the given constant with the value referenced by the [c.Reference, c.Value] pair. /// /// The Constant to translate /// The list of enums to check. - /// The list of auxilliary enums to check. /// True if the reference was found; false otherwise. public static bool TranslateConstantWithReference(Constant c, EnumCollection enums) { if (c == null) + { throw new ArgumentNullException("c"); + } if (enums == null) + { throw new ArgumentNullException("enums"); + } if (!String.IsNullOrEmpty(c.Reference)) { @@ -192,8 +159,6 @@ namespace Bind.Structures return true; } - #region ToString - public override string ToString() { return @@ -204,18 +169,14 @@ namespace Bind.Structures Value); } - #endregion - - #region IComparable Members - public int CompareTo(Constant other) { int ret = Value.CompareTo(other.Value); if (ret == 0) + { return Name.CompareTo(other.Name); + } return ret; } - - #endregion } } diff --git a/src/Generator.Bind/Structures/Delegate.cs b/src/Generator.Bind/Structures/Delegate.cs index 61f290b9..af3d2873 100644 --- a/src/Generator.Bind/Structures/Delegate.cs +++ b/src/Generator.Bind/Structures/Delegate.cs @@ -1,17 +1,12 @@ -#region --- License --- /* Copyright (c) 2006, 2007 Stefanos Apostolopoulos * See license.txt for license info */ -#endregion using System; using System.Collections.Generic; -using System.Diagnostics; -using System.IO; using System.Linq; using System.Text; using System.Text.RegularExpressions; -using System.Xml.XPath; namespace Bind.Structures { @@ -19,22 +14,20 @@ namespace Bind.Structures /// Represents an opengl function. /// The return value, function name, function parameters and opengl version can be retrieved or set. /// - class Delegate : IComparable, IEquatable + internal class Delegate : IComparable, IEquatable { //internal static DelegateCollection Delegates; - bool? cls_compliance_overriden; + private bool? cls_compliance_overriden; protected static Regex endings = new Regex(@"((((d|f|fi)|u?[isb])_?v?)|v)", RegexOptions.Compiled | RegexOptions.RightToLeft); protected static Regex endingsNotToTrim = new Regex("(ib|[tdrey]s|[eE]n[vd]|bled|Flag|Tess|Status|Pixels|Instanced|Indexed|Varyings|Boolean|IDs)", RegexOptions.Compiled | RegexOptions.RightToLeft); // Add a trailing v to functions matching this regex. Used to differntiate between overloads taking both // a 'type' and a 'ref type' (such overloads are not CLS Compliant). - // The default Regex matches no functions. Create a new Regex in Bind.Generator classes to override the default behavior. + // The default Regex matches no functions. Create a new Regex in Bind.Generator classes to override the default behavior. internal static Regex endingsAddV = new Regex("^0", RegexOptions.Compiled); - #region --- Constructors --- - public Delegate() { Parameters = new ParameterCollection(); @@ -57,12 +50,6 @@ namespace Bind.Structures Slot = d.Slot; } - #endregion - - #region --- Properties --- - - #region public bool CLSCompliant - /// /// Gets the CLSCompliant property. True if the delegate is not CLSCompliant. /// @@ -71,18 +58,26 @@ namespace Bind.Structures get { if (cls_compliance_overriden != null) + { return (bool)cls_compliance_overriden; + } if (Unsafe) + { return false; + } if (!ReturnType.CLSCompliant) + { return false; + } foreach (Parameter p in Parameters) { if (!p.CLSCompliant) + { return false; + } } return true; } @@ -92,21 +87,7 @@ namespace Bind.Structures } } - #endregion - - #region public string Category - - private string _category; - - public string Category - { - get { return _category; } - set { _category = value; } - } - - #endregion - - #region public bool NeedsWrapper + public string Category { get; set; } /// /// Gets a value that indicates whether this function needs to be wrapped with a Marshaling function. @@ -120,22 +101,22 @@ namespace Bind.Structures // TODO: Add special cases for (Get)ShaderSource. if (ReturnType.WrapperType != WrapperTypes.None) + { return true; + } foreach (Parameter p in Parameters) { if (p.WrapperType != WrapperTypes.None) + { return true; + } } return false; } } - #endregion - - #region public virtual bool Unsafe - /// /// True if the delegate must be declared as 'unsafe'. /// @@ -149,7 +130,9 @@ namespace Bind.Structures // return false; if (ReturnType.Pointer != 0) + { return true; + } foreach (Parameter p in Parameters) { @@ -163,28 +146,12 @@ namespace Bind.Structures } } - #endregion - - #region public Parameter ReturnType - - Type _return_type = new Type(); /// /// Gets or sets the return value of the opengl function. /// - public Type ReturnType - { - get { return _return_type; } - set - { - _return_type = value; - } - } + public Type ReturnType { get; set; } = new Type(); - #endregion - - #region public virtual string Name - - string _name; + private string _name; /// /// Gets or sets the name of the opengl function. /// @@ -200,36 +167,12 @@ namespace Bind.Structures } } - #endregion - - #region public ParameterCollection Parameters - - ParameterCollection _parameters; - - public ParameterCollection Parameters - { - get { return _parameters; } - set { _parameters = value; } - } - - #endregion - - #region public string Version - - string _version; + public ParameterCollection Parameters { get; set; } /// /// Defines the opengl version that introduced this function. /// - public string Version - { - get { return _version; } - set { _version = value; } - } - - #endregion - - #region public bool Extension + public string Version { get; set; } public string Extension { @@ -237,8 +180,6 @@ namespace Bind.Structures set; } - #endregion - public bool Deprecated { get; set; } public string DeprecatedVersion { get; set; } public string EntryPoint { get; set; } @@ -247,8 +188,6 @@ namespace Bind.Structures // Slot index in the address table public int Slot { get; set; } - #endregion - // This method should only be used for debugging purposes, not for code generation! // Returns a string representing the full delegate declaration without decorations. // (ie "(unsafe) void delegate glXxxYyy(int a, float b, IntPtr c)" @@ -266,22 +205,20 @@ namespace Bind.Structures return sb.ToString(); } - #region IComparable Members - public int CompareTo(Delegate other) { int ret = Name.CompareTo(other.Name); if (ret == 0) + { ret = Parameters.CompareTo(other.Parameters); + } if (ret == 0) + { ret = ReturnType.CompareTo(other.ReturnType); + } return ret; } - #endregion - - #region IEquatable Members - public bool Equals(Delegate other) { return @@ -289,15 +226,11 @@ namespace Bind.Structures Parameters.Equals(other.Parameters) && ReturnType.Equals(other.ReturnType); } - - #endregion } - #region DelegateCollection - - class DelegateCollection : IDictionary> + internal class DelegateCollection : IDictionary> { - readonly SortedDictionary> Delegates = + private readonly SortedDictionary> Delegates = new SortedDictionary>(); public void Add(Delegate d) @@ -348,8 +281,6 @@ namespace Bind.Structures } } - #region IDictionary Members - public void Add(string key, List value) { Delegates.Add(key, value.ToList()); @@ -398,10 +329,6 @@ namespace Bind.Structures } } - #endregion - - #region ICollection implementation - public void Add(KeyValuePair> item) { Delegates.Add(item.Key, item.Value.ToList()); @@ -443,26 +370,14 @@ namespace Bind.Structures } } - #endregion - - #region IEnumerable implementation - public IEnumerator>> GetEnumerator() { return Delegates.GetEnumerator(); } - #endregion - - #region IEnumerable implementation - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return Delegates.GetEnumerator(); } - - #endregion } - - #endregion } diff --git a/src/Generator.Bind/Structures/Documentation.cs b/src/Generator.Bind/Structures/Documentation.cs index 3be81b9c..6c9b26dd 100644 --- a/src/Generator.Bind/Structures/Documentation.cs +++ b/src/Generator.Bind/Structures/Documentation.cs @@ -1,5 +1,4 @@ -#region License -// +// // Documentation.cs // // Author: @@ -25,20 +24,18 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // -#endregion -using System; using System.Collections.Generic; namespace Bind.Structures { - class Documentation + internal class Documentation { public string Summary { get; set; } public List Parameters { get; set; } } - class DocumentationParameter + internal class DocumentationParameter { public string Name { get; set; } public string Documentation { get; set; } diff --git a/src/Generator.Bind/Structures/Enum.cs b/src/Generator.Bind/Structures/Enum.cs index 85c79cea..b8632e86 100644 --- a/src/Generator.Bind/Structures/Enum.cs +++ b/src/Generator.Bind/Structures/Enum.cs @@ -1,23 +1,16 @@ -#region --- License --- /* Copyright (c) 2006, 2007 Stefanos Apostolopoulos * See license.txt for license info */ -#endregion using System; using System.Collections.Generic; -using System.IO; using System.Linq; -using System.Text; -using System.Xml.XPath; namespace Bind.Structures { - #region class Enum - - class Enum + internal class Enum { - string _name, _type; + private string _name, _type; public Enum() { @@ -43,7 +36,7 @@ namespace Bind.Structures set { _type = value; } } - SortedDictionary _constant_collection = new SortedDictionary(); + private SortedDictionary _constant_collection = new SortedDictionary(); public IDictionary ConstantCollection { @@ -51,8 +44,10 @@ namespace Bind.Structures set { if (value == null) + { throw new ArgumentNullException("value"); - + } + _constant_collection.Clear(); foreach (var item in value) { @@ -81,46 +76,50 @@ namespace Bind.Structures public bool CLSCompliant { get; set; } } - #endregion - - #region class EnumCollection - - class EnumCollection : IDictionary + internal class EnumCollection : IDictionary { - SortedDictionary Enumerations = new SortedDictionary(); + private SortedDictionary Enumerations = new SortedDictionary(); // Return -1 for ext1, 1 for ext2 or 0 if no preference. - int OrderOfPreference(string ext1, string ext2) + private int OrderOfPreference(string ext1, string ext2) { // If one is empty and the other not, prefer the empty one (empty == core) // Otherwise check for Arb and Ext. To reuse the logic for the // empty check, let's try to remove first Arb, then Ext from the strings. int ret = PreferEmpty(ext1, ext2); if (ret != 0) + { return ret; - + } + ext1 = ext1.Replace("Arb", ""); ext2 = ext2.Replace("Arb", ""); ret = PreferEmpty(ext1, ext2); if (ret != 0) + { return ret; - + } + ext1 = ext1.Replace("Ext", ""); ext2 = ext2.Replace("Ext", ""); return PreferEmpty(ext1, ext2); } // Prefer the empty string over the non-empty. - int PreferEmpty(string ext1, string ext2) + private int PreferEmpty(string ext1, string ext2) { if (String.IsNullOrEmpty(ext1) && !String.IsNullOrEmpty(ext2)) + { return -1; + } else if (String.IsNullOrEmpty(ext2) && !String.IsNullOrEmpty(ext1)) + { return 1; + } else + { return 0; + } } - #region Public Members - public void Add(Enum e) { Add(e.Name, e); @@ -134,10 +133,6 @@ namespace Bind.Structures } } - #endregion - - #region IDictionary Members - public void Add(string key, Enum value) { if (ContainsKey(key)) @@ -235,9 +230,5 @@ namespace Bind.Structures { return Enumerations.GetEnumerator(); } - - #endregion } - - #endregion } diff --git a/src/Generator.Bind/Structures/FlowDirection.cs b/src/Generator.Bind/Structures/FlowDirection.cs index 33291563..9ea4fa61 100644 --- a/src/Generator.Bind/Structures/FlowDirection.cs +++ b/src/Generator.Bind/Structures/FlowDirection.cs @@ -1,4 +1,3 @@ -#region License // // The Open Toolkit Library License // @@ -6,7 +5,7 @@ // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights to +// in the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: @@ -23,18 +22,28 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. // -#endregion namespace Bind.Structures { + /// + /// Enumarates the possible flows of a parameter (ie. is this parameter + /// used as input or as output?) + /// + public enum FlowDirection + { /// - /// Enumarates the possible flows of a parameter (ie. is this parameter - /// used as input or as output?) + /// No defined flow. /// - public enum FlowDirection - { - Undefined = 0, - In, - Out - } + Undefined = 0, + + /// + /// Input parameter. + /// + In, + + /// + /// Output parameter, typically decorated with the out keyword. + /// + Out + } } diff --git a/src/Generator.Bind/Structures/Function.cs b/src/Generator.Bind/Structures/Function.cs index f49f3cb0..939c4d93 100644 --- a/src/Generator.Bind/Structures/Function.cs +++ b/src/Generator.Bind/Structures/Function.cs @@ -1,8 +1,6 @@ -#region --- License --- -/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos +/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos * See license.txt for license info */ -#endregion using System; using System.Collections.Generic; @@ -12,16 +10,8 @@ using System.Text.RegularExpressions; namespace Bind.Structures { - class Function : Delegate, IEquatable, IComparable + internal class Function : Delegate, IEquatable, IComparable { - #region Fields - - Delegate wrapped_delegate; - - #endregion - - #region --- Constructors --- - public Function(Delegate d) : base(d) { @@ -42,19 +32,7 @@ namespace Bind.Structures Body.AddRange(f.Body); } - #endregion - - #region public Delegate WrappedDelegate - - public Delegate WrappedDelegate - { - get { return wrapped_delegate; } - set { wrapped_delegate = value; } - } - - #endregion - - #region public void TurnVoidPointersToIntPtr() + public Delegate WrappedDelegate { get; set; } public void TurnVoidPointersToIntPtr() { @@ -68,10 +46,6 @@ namespace Bind.Structures } } - #endregion - - #region public override bool Unsafe - public override bool Unsafe { get @@ -80,34 +54,12 @@ namespace Bind.Structures } } - #endregion - - #region public FunctionBody Body - - FunctionBody _body; - - public FunctionBody Body - { - get { return _body; } - set { _body = value; } - } - - #endregion - - #region public string TrimmedName + public FunctionBody Body { get; set; } public string TrimmedName { get; set; } - #endregion - - #region Documentation - public Documentation Documentation { get; set; } - #endregion - - #region ToString - public override string ToString() { return String.Format("{0} {1}{2}", @@ -116,10 +68,6 @@ namespace Bind.Structures Parameters); } - #endregion - - #region IEquatable Members - public bool Equals(Function other) { bool result = @@ -129,31 +77,38 @@ namespace Bind.Structures return result; } - #endregion - - #region IComparable Members - public int CompareTo(Function other) { int ret = Name.CompareTo(other.Name); if (ret == 0) + { ret = Parameters.CompareTo(other.Parameters); + } if (ret == 0) + { ret = ReturnType.CompareTo(other.ReturnType); + } return ret; } - - #endregion } - #region class FunctionBody : List - + /// + /// The class acts as a wrapper around a block of source code that makes up the body + /// of a function. + /// public class FunctionBody : List { + /// + /// Initializes an empty . + /// public FunctionBody() { } + /// + /// Initializes a from an existing FunctionBody. + /// + /// The body to copy from. public FunctionBody(FunctionBody fb) { foreach (string s in fb) @@ -164,24 +119,42 @@ namespace Bind.Structures private string indent = ""; + /// + /// Indents this another level. + /// public void Indent() { indent += " "; } + /// + /// Removes a level of indentation from this . + /// public void Unindent() { if (indent.Length > 4) + { indent = indent.Substring(4); + } else + { indent = String.Empty; + } } + /// + /// Adds a line of source code to the body at the current indentation level. + /// + /// The line to add. new public void Add(string s) { base.Add(indent + s.TrimEnd('\r', '\n')); } + /// + /// Adds a range of source code lines to the body at the current indentation level. + /// + /// new public void AddRange(IEnumerable collection) { foreach (string t in collection) @@ -190,10 +163,16 @@ namespace Bind.Structures } } + /// + /// Builds the contents of the function body into a string and encloses it with braces. + /// + /// The body, enclosed in braces. public override string ToString() { if (Count == 0) + { return String.Empty; + } StringBuilder sb = new StringBuilder(Count); @@ -208,15 +187,11 @@ namespace Bind.Structures } } - #endregion - - #region class FunctionCollection : SortedDictionary> - - class FunctionCollection : SortedDictionary> + internal class FunctionCollection : SortedDictionary> { - Regex unsignedFunctions = new Regex(@".+(u[dfisb]v?)", RegexOptions.Compiled); + private Regex unsignedFunctions = new Regex(@".+(u[dfisb]v?)", RegexOptions.Compiled); - void Add(Function f) + private void Add(Function f) { if (!ContainsKey(f.Extension)) { @@ -276,6 +251,4 @@ namespace Bind.Structures } } } - - #endregion } diff --git a/src/Generator.Bind/Structures/Parameter.cs b/src/Generator.Bind/Structures/Parameter.cs index 762812a4..297422ed 100644 --- a/src/Generator.Bind/Structures/Parameter.cs +++ b/src/Generator.Bind/Structures/Parameter.cs @@ -1,31 +1,25 @@ -#region --- License --- /* Copyright (c) 2006, 2007 Stefanos Apostolopoulos * See license.txt for license info */ -#endregion using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; -using System.Xml.XPath; namespace Bind.Structures { /// /// Represents a single parameter of an opengl function. /// - class Parameter : Type, IComparable, IEquatable + internal class Parameter : Type, IComparable, IEquatable { - string cache; - - #region Constructors + private string cache; /// /// Creates a new Parameter without type and name. /// public Parameter() - :base() { } @@ -37,7 +31,9 @@ namespace Bind.Structures : base(p) { if (p == null) + { return; + } Name = p.Name; Unchecked = p.Unchecked; @@ -49,10 +45,6 @@ namespace Bind.Structures //this.rebuild = false; } - #endregion - - #region RawName - /// /// Gets or sets the raw name of the parameter. /// @@ -62,10 +54,6 @@ namespace Bind.Structures private set; } - #endregion - - #region Name - /// /// Gets the name of the parameter. If the name matches a keyword of the current language, /// then it is escaped with . @@ -90,11 +78,7 @@ namespace Bind.Structures } } - #endregion - - #region UnmanagedType - - UnmanagedType _unmanaged_type; + private UnmanagedType _unmanaged_type; /// /// Gets or sets the name of the parameter. /// @@ -110,11 +94,7 @@ namespace Bind.Structures } } - #endregion - - #region public FlowDirection Flow - - FlowDirection _flow; + private FlowDirection _flow; /// /// Gets or sets the flow of the parameter. @@ -131,10 +111,6 @@ namespace Bind.Structures } } - #endregion - - #region public bool NeedsPin - public bool NeedsPin { get @@ -144,10 +120,6 @@ namespace Bind.Structures } } - #endregion - - #region public bool Unchecked - private bool _unchecked; public bool Unchecked @@ -162,20 +134,7 @@ namespace Bind.Structures } } - #endregion - - #region public bool Generic - - bool generic; - public bool Generic - { - get { return generic; } - set { generic = value; } - } - - #endregion - - #region public bool DiffersOnlyOnReference + public bool Generic { get; set; } // Returns true if this parameter differs only on reference compared to another parameter, i.e: // returns true for 'int' & 'ref int' @@ -191,20 +150,7 @@ namespace Bind.Structures other.Reference && !(Reference || Array > 0 || Pointer != 0)); } - #endregion - - #region public string ComputeSize - - string computeSize; - public string ComputeSize - { - get { return computeSize; } - set { computeSize = value; } - } - - #endregion - - #region Static Members + public string ComputeSize { get; set; } // Returns the FlowDirection that matches the specified string // ("out" or "in", otherwise undefined). @@ -212,37 +158,28 @@ namespace Bind.Structures { return direction == "out" ? FlowDirection.Out : direction == "in" ? FlowDirection.In : FlowDirection.Undefined; } - - #endregion - #region IComparable Members public int CompareTo(Parameter other) { int result = base.CompareTo(other); if (result == 0) + { result = Name.CompareTo(other.Name); + } return result; } - #endregion - - #region ToString - public override string ToString() { return String.Format("{2}{0} {1}", base.ToString(), Name, - Reference ? + Reference ? Flow == FlowDirection.Out ? "out " : "ref " : String.Empty); } - #endregion - - #region IEquatable Members - public bool Equals(Parameter other) { bool result = @@ -251,26 +188,22 @@ namespace Bind.Structures return result; } - - #endregion } /// /// Holds the parameter list of an opengl function. /// - class ParameterCollection : IList, IComparable, IEquatable + internal class ParameterCollection : IList, IComparable, IEquatable { - readonly List Parameters = new List(); + private readonly List Parameters = new List(); - bool hasPointerParameters; - bool hasReferenceParameters; - bool hasUnsignedParameters; - bool hasGenericParameters; + private bool hasPointerParameters; + private bool hasReferenceParameters; + private bool hasUnsignedParameters; + private bool hasGenericParameters; public bool Rebuild { get; set; } - Settings Settings { get; set; } - - #region Constructors + private Settings Settings { get; set; } public ParameterCollection() { @@ -287,23 +220,17 @@ namespace Bind.Structures public ParameterCollection(IEnumerable parameters) { foreach (Parameter p in parameters) + { Add(new Parameter(p)); + } } - #endregion - - #region BuildCache - - void BuildCache() + private void BuildCache() { BuildReferenceAndPointerParametersCache(); Rebuild = false; } - #endregion - - #region public bool HasPointerParameters - public bool HasPointerParameters { get @@ -317,10 +244,6 @@ namespace Bind.Structures } } - #endregion - - #region public bool HasReferenceParameters - public bool HasReferenceParameters { get @@ -334,10 +257,6 @@ namespace Bind.Structures } } - #endregion - - #region public bool HasUnsignedParameters - public bool HasUnsignedParameters { get @@ -351,10 +270,6 @@ namespace Bind.Structures } } - #endregion - - #region public bool HasGenericParameters - public bool HasGenericParameters { get @@ -367,33 +282,34 @@ namespace Bind.Structures return hasGenericParameters; } } - - #endregion - #region void BuildReferenceAndPointerParametersCache() - void BuildReferenceAndPointerParametersCache() + private void BuildReferenceAndPointerParametersCache() { foreach (Parameter p in this) { if (p.Pointer != 0 || p.CurrentType.Contains("IntPtr")) + { hasPointerParameters = true; + } if (p.Reference) + { hasReferenceParameters = true; + } if (p.Unsigned) + { hasUnsignedParameters = true; + } if (p.Generic) + { hasGenericParameters = true; + } } } - #endregion - - #region ToString - // Only use for debugging, not for code generation! public override string ToString() { @@ -409,27 +325,25 @@ namespace Bind.Structures sb.Replace(", ", ")", sb.Length - 2, 2); } else + { sb.Append(")"); + } return sb.ToString(); } - #endregion - - #region ContainsType - public bool ContainsType(string type) { foreach (Parameter p in this) + { if (p.CurrentType == type) + { return true; + } + } return false; } - #endregion - - #region IList Members - public void Add(Parameter p) { Parameters.Add(p); @@ -511,10 +425,6 @@ namespace Bind.Structures } } - #endregion - - #region IComparable Members - public int CompareTo(ParameterCollection other) { if (Count < other.Count) @@ -531,20 +441,20 @@ namespace Bind.Structures { int result = this[i].CompareTo(other[i]); if (result != 0) + { return result; + } } return 0; } } - #endregion - - #region IEquatable Members - public bool Equals(ParameterCollection other) { if (Count != other.Count) + { return false; + } bool result = true; for (int i = 0; i < Count && result; i++) @@ -553,7 +463,5 @@ namespace Bind.Structures } return result; } - - #endregion } } diff --git a/src/Generator.Bind/Structures/Type.cs b/src/Generator.Bind/Structures/Type.cs index 46894a8b..cfe909be 100644 --- a/src/Generator.Bind/Structures/Type.cs +++ b/src/Generator.Bind/Structures/Type.cs @@ -1,23 +1,14 @@ -#region --- License --- -/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos +/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos * See license.txt for license info */ -#endregion using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Xml.XPath; namespace Bind.Structures { - class Type : IComparable, IEquatable + internal class Type : IComparable, IEquatable { - string current_qualifier = String.Empty; - string previous_qualifier = String.Empty; - - #region --- Constructors --- + private string current_qualifier = String.Empty; public Type() { @@ -39,25 +30,13 @@ namespace Bind.Structures } } - #endregion - - #region Private Members - - string CurrentQualifier + private string CurrentQualifier { get { return current_qualifier; } set { PreviousQualifier = CurrentQualifier; current_qualifier = value; } } - string PreviousQualifier - { - get { return previous_qualifier; } - set { previous_qualifier = value; } - } - - #endregion - - #region Public Members + private string PreviousQualifier { get; set; } = String.Empty; public string QualifiedType { @@ -71,7 +50,9 @@ namespace Bind.Structures set { if (String.IsNullOrEmpty(value)) + { throw new ArgumentNullException(); + } int qualifier_end = value.LastIndexOf('.'); if (qualifier_end > -1) @@ -87,9 +68,7 @@ namespace Bind.Structures } } - #region public string CurrentType - - string type; + private string type; /// /// Gets the type of the parameter. /// @@ -102,12 +81,18 @@ namespace Bind.Structures set { if (String.IsNullOrEmpty(value)) + { throw new ArgumentException(); + } if (!String.IsNullOrEmpty(type)) + { PreviousType = type; + } if (!String.IsNullOrEmpty(value)) + { type = value.Trim(); + } while (type.EndsWith("*")) { @@ -117,35 +102,11 @@ namespace Bind.Structures } } - #endregion + public string PreviousType { get; private set; } - #region public string PreviousType + public bool Reference { get; set; } - private string _previous_type; - - public string PreviousType - { - get { return _previous_type; } - private set { _previous_type = value; } - } - - #endregion - - #region public bool Reference - - bool reference; - - public bool Reference - { - get { return reference; } - set { reference = value; } - } - - #endregion - - #region public int Array - - int array; + private int array; public int Array { @@ -153,11 +114,7 @@ namespace Bind.Structures set { array = value > 0 ? value : 0; } } - #endregion - - #region public int ElementCount - - int element_count; + private int element_count; // If the type is an array and ElementCount > 0, then ElemenCount defines the expected array length. public int ElementCount @@ -166,11 +123,7 @@ namespace Bind.Structures set { element_count = value > 0 ? value : 0; } } - #endregion - - #region public int Pointer - - int pointer; + private int pointer; public int Pointer { @@ -178,12 +131,9 @@ namespace Bind.Structures set { pointer = value > 0 ? value : 0; } } - #endregion - // Set to true if parameter is an enum. public bool IsEnum { get; set; } - - #region public bool CLSCompliant + public bool CLSCompliant { @@ -238,10 +188,6 @@ namespace Bind.Structures } } - #endregion - - #region public bool Unsigned - public bool Unsigned { get @@ -250,23 +196,9 @@ namespace Bind.Structures } } - #endregion + public WrapperTypes WrapperType { get; set; } = WrapperTypes.None; - #region public WrapperTypes WrapperType - - private WrapperTypes _wrapper_type = WrapperTypes.None; - - public WrapperTypes WrapperType - { - get { return _wrapper_type; } - set { _wrapper_type = value; } - } - - #endregion - - #region public override string ToString() - - static readonly string[] PointerLevels = + private static readonly string[] PointerLevels = { "", "*", @@ -275,7 +207,7 @@ namespace Bind.Structures "****" }; - static readonly string[] ArrayLevels = + private static readonly string[] ArrayLevels = { "", "[]", @@ -292,12 +224,6 @@ namespace Bind.Structures ArrayLevels[Array]); } - #endregion - - #endregion - - #region IComparable Members - public int CompareTo(Type other) { // Make sure that Pointer parameters are sorted last to avoid bug [#1098]. @@ -306,26 +232,32 @@ namespace Bind.Structures // DelegateCollection.Add that depends on this fact. int result = this.CurrentType.CompareTo(other.CurrentType); if (result == 0) + { result = Pointer.CompareTo(other.Pointer); // Must come after array/ref, see issue [#1098] + } if (result == 0) + { result = Reference.CompareTo(other.Reference); + } if (result == 0) + { result = Array.CompareTo(other.Array); + } // Note: CLS-compliance and element counts // are used for comparison calculations, in order // to maintain a stable sorting order, even though // they are not used in equality calculations. if (result == 0) + { result = CLSCompliant.CompareTo(other.CLSCompliant); + } if (result == 0) + { result = ElementCount.CompareTo(other.ElementCount); + } return result; } - #endregion - - #region IEquatable Members - public bool Equals(Type other) { bool result = @@ -341,7 +273,5 @@ namespace Bind.Structures // redefinition errors in the generated bindings. return result; } - - #endregion } } diff --git a/src/Generator.Bind/Utilities.cs b/src/Generator.Bind/Utilities.cs index 993513e6..2d55f4ff 100644 --- a/src/Generator.Bind/Utilities.cs +++ b/src/Generator.Bind/Utilities.cs @@ -1,8 +1,6 @@ -#region --- License --- -/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos +/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos * See license.txt for license info */ -#endregion using System; using System.Collections.Generic; @@ -15,8 +13,10 @@ using Enum=Bind.Structures.Enum; namespace Bind { - #region WrapperTypes enum - + /// + /// Defines different types of parameter wrapper identifiers, which are used for hinting at how the method + /// signatures should be generated. + /// [Flags] public enum WrapperTypes { @@ -94,11 +94,13 @@ namespace Bind /// Add an int32 overload for convenience. /// SizeParameter = 1 << 14, + /// + /// Function takes a ref but we emit a legacy array overload to maintain backwards compatability. + /// + LegacyArrayParameter = 1 << 15, } - #endregion - - static class Utilities + internal static class Utilities { public static readonly char[] Separators = { ' ', '\n', ',', '(', ')', ';', '#' }; public static Regex Extensions { get; private set; } @@ -109,9 +111,9 @@ namespace Bind // Note: REMOVING THESE WILL BREAK BINARY-COMPATIBILITY WITH OPENTK 1.0, // WRT THE ES 1.1 API. // You have been warned. - static List extension_names = new List + private static List extension_names = new List { - "SGI", "SGIS", "SGIX", "IBM", "AMD", "INTEL", + "SGI", "SGIS", "SGIX", "IBM", "AMD", "INTEL", }; public static void AddExtensions(IEnumerable extensions) @@ -149,12 +151,12 @@ namespace Bind } } - #region internal StreamReader OpenSpecFile(string file) - internal static StreamReader OpenSpecFile(string folder, string file) { if (String.IsNullOrEmpty(folder) || String.IsNullOrEmpty(file)) + { return null; + } Console.WriteLine(folder); Console.WriteLine(file); @@ -163,10 +165,6 @@ namespace Bind return new StreamReader(path); } - #endregion - - #region Keywords - public static readonly List CSharpKeywords = new List( new string[] { @@ -193,10 +191,6 @@ namespace Bind } ); - #endregion - - #region Merge - // Merges the specified enum collections. internal static void Merge(EnumCollection enums, EnumCollection new_enums) { @@ -245,7 +239,7 @@ namespace Bind else { // Tried to add a constant that already exists. If one constant - // is like: 'Foo = 0x5' and the other like: 'Foo = Bar.Foo', then + // is like: 'Foo = 0x5' and the other like: 'Foo = Bar.Foo', then // keep the first one. if (!String.IsNullOrEmpty(s.ConstantCollection[t.Name].Reference)) { @@ -256,10 +250,6 @@ namespace Bind return s; } - #endregion - - #region internal static string GetGL2Extension(string name) - internal static string GetGL2Extension(string name) { return GetExtension(name, false); @@ -286,26 +276,16 @@ namespace Bind } } - #endregion - - #region private static bool IsGL2Extension(string function) - private static bool IsGL2Extension(string function) { return !String.IsNullOrEmpty(GetGL2Extension(function)); } - #endregion - - #region internal static string StripGL2Extension(string p) - internal static string StripGL2Extension(string p) { return p.Substring(0, p.Length - GetGL2Extension(p).Length); } - #endregion - public static bool RequiresSlot(this Delegate d, Settings settings) { double version; diff --git a/src/Generator.Bind/XmlSpecReader.cs b/src/Generator.Bind/XmlSpecReader.cs index bc16062f..7907dfe3 100644 --- a/src/Generator.Bind/XmlSpecReader.cs +++ b/src/Generator.Bind/XmlSpecReader.cs @@ -1,12 +1,11 @@ -#region License -// +// // The Open Toolkit Library License // // Copyright (c) 2006 - 2013 Stefanos Apostolopoulos for the Open Toolkit library. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights to +// in the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: @@ -23,14 +22,10 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. // -#endregion using System; using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Xml.Linq; using System.Xml.XPath; using Bind.Structures; @@ -39,23 +34,19 @@ namespace Bind using Delegate = Bind.Structures.Delegate; using Enum = Bind.Structures.Enum; - class XmlSpecReader : ISpecReader + internal class XmlSpecReader : ISpecReader { - Settings Settings { get; set; } - - #region Constructors + private Settings Settings { get; set; } public XmlSpecReader(Settings settings) { if (settings == null) + { throw new ArgumentNullException("settings"); + } Settings = settings; } - #endregion - - #region ISpecReader Members - public void ReadDelegates(string file, DelegateCollection delegates, string apiname, string apiversions) { var specs = new XPathDocument(file); @@ -79,7 +70,9 @@ namespace Bind foreach (XPathNavigator nav in specs.CreateNavigator().Select(xpath_delete)) { foreach (XPathNavigator node in nav.SelectChildren("function", String.Empty)) + { delegates.Remove(node.GetAttribute("name", String.Empty)); + } } foreach (XPathNavigator nav in specs.CreateNavigator().Select(xpath_add)) { @@ -113,7 +106,9 @@ namespace Bind foreach (XPathNavigator nav in specs.CreateNavigator().Select(xpath_delete)) { foreach (XPathNavigator node in nav.SelectChildren("enum", String.Empty)) + { enums.Remove(node.GetAttribute("name", String.Empty)); + } } foreach (XPathNavigator nav in specs.CreateNavigator().Select(xpath_add)) { @@ -130,14 +125,18 @@ namespace Bind Dictionary GLTypes = new Dictionary(); if (sr == null) + { return GLTypes; + } do { string line = sr.ReadLine(); if (String.IsNullOrEmpty(line) || line.StartsWith("#")) + { continue; + } string[] words = line.Split(" ,*\t".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); @@ -198,14 +197,20 @@ namespace Bind { string line = sr.ReadLine(); if (String.IsNullOrEmpty(line) || line.StartsWith("#")) + { continue; + } string[] words = line.Split(" ,\t".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); if (words.Length < 2) + { continue; + } if (((Settings.Compatibility & Settings.Legacy.NoBoolParameters) != Settings.Legacy.None) && words[1] == "bool") + { words[1] = "Int32"; + } CSTypes.Add(words[0], words[1]); } @@ -214,11 +219,7 @@ namespace Bind } } - #endregion - - #region Private Members - - static void GetSignaturePaths(string apiname, string apiversion, out string xpath_add, out string xpath_delete) + private static void GetSignaturePaths(string apiname, string apiversion, out string xpath_add, out string xpath_delete) { xpath_add = "/signatures/add"; xpath_delete = "/signatures/delete"; @@ -230,7 +231,7 @@ namespace Bind "(contains(concat('|', @version, '|'), '|{1}|') or not(boolean(@version)))]", apiname, apiversion); - xpath_add += match; + xpath_add += match; xpath_delete += match; } else if (!String.IsNullOrEmpty(apiname)) @@ -241,7 +242,7 @@ namespace Bind } } - string GetSpecVersion(XPathDocument specs) + private string GetSpecVersion(XPathDocument specs) { var version = specs.CreateNavigator().SelectSingleNode("/signatures") @@ -253,7 +254,7 @@ namespace Bind return version; } - DelegateCollection ReadDelegates(XPathNavigator specs, string apiversion) + private DelegateCollection ReadDelegates(XPathNavigator specs, string apiversion) { DelegateCollection delegates = new DelegateCollection(); var extensions = new List(); @@ -269,7 +270,9 @@ namespace Bind // so we add them anyway (which is desirable). if (!String.IsNullOrEmpty(version) && !String.IsNullOrEmpty(apiversion) && Decimal.Parse(version) > Decimal.Parse(apiversion)) + { continue; + } // Check whether we are adding to an existing delegate or creating a new one. var d = new Delegate @@ -284,7 +287,9 @@ namespace Bind Obsolete = node.GetAttribute("obsolete", String.Empty).Trim() }; if (!extensions.Contains(d.Extension)) + { extensions.Add(d.Extension); + } foreach (XPathNavigator param in node.SelectChildren(XPathNodeType.Element)) { @@ -299,26 +304,12 @@ namespace Bind p.CurrentType = param.GetAttribute("type", String.Empty).Trim(); p.Name = param.GetAttribute("name", String.Empty).Trim(); - string element_count = param.GetAttribute("elementcount", String.Empty).Trim(); - if (String.IsNullOrEmpty(element_count)) - { - element_count = param.GetAttribute("count", String.Empty).Trim(); - if (!String.IsNullOrEmpty(element_count)) - { - int count; - if (Int32.TryParse(element_count, out count)) - { - p.ElementCount = count; - } - } - } - p.ComputeSize = param.GetAttribute("count", String.Empty).Trim(); - if (p.ComputeSize.StartsWith("COMPSIZE")) + + int elementCount; + if (Int32.TryParse(p.ComputeSize, out elementCount)) { - //remove the compsize hint, just keep comma delimited param names - var len = "COMPSIZE(".Length; - p.ComputeSize = p.ComputeSize.Substring(len, (p.ComputeSize.Length - len) - 1); + p.ElementCount = elementCount; } p.Flow = Parameter.GetFlowDirection(param.GetAttribute("flow", String.Empty).Trim()); @@ -335,7 +326,7 @@ namespace Bind return delegates; } - EnumCollection ReadEnums(XPathNavigator nav) + private EnumCollection ReadEnums(XPathNavigator nav) { EnumCollection enums = new EnumCollection(); Enum all = new Enum() { Name = Settings.CompleteEnumName }; @@ -356,7 +347,9 @@ namespace Bind e.Obsolete = node.GetAttribute("obsolete", String.Empty).Trim(); if (String.IsNullOrEmpty(e.Name)) + { throw new InvalidOperationException(String.Format("Empty name for enum element {0}", node.ToString())); + } // It seems that all flag collections contain "Mask" in their names. // This looks like a heuristic, but it holds 100% in practice @@ -466,7 +459,5 @@ restart: Utilities.Merge(enums, all); return enums; } - - #endregion } } diff --git a/src/Generator.Bind/paket.references b/src/Generator.Bind/paket.references index e69de29b..9504c325 100644 --- a/src/Generator.Bind/paket.references +++ b/src/Generator.Bind/paket.references @@ -0,0 +1 @@ +StyleCop.Analyzers \ No newline at end of file diff --git a/src/Generator.Converter/GLXmlParser.cs b/src/Generator.Converter/GLXmlParser.cs index 5cbfdd52..5891232d 100644 --- a/src/Generator.Converter/GLXmlParser.cs +++ b/src/Generator.Converter/GLXmlParser.cs @@ -1,4 +1,3 @@ - #region License // // The Open Toolkit Library License // @@ -6,7 +5,7 @@ // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights to +// in the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: @@ -23,7 +22,6 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. // -#endregion using System; using System.Collections.Generic; @@ -34,7 +32,7 @@ using System.Xml.Linq; namespace OpenTK.Convert { - static class Extension + internal static class Extension { public static string ValueOrDefault(this XAttribute a) { @@ -42,13 +40,11 @@ namespace OpenTK.Convert } } - class GLXmlParser : Parser + internal class GLXmlParser : XmlParser { - static readonly Regex ExtensionRegex = new Regex( + private static readonly Regex ExtensionRegex = new Regex( @"3DFX|(?!(?<=[1-4])D)[A-Z]{2,}$", RegexOptions.Compiled); - string EnumPrefix { get { return Prefix.ToUpper() + "_"; } } - string FuncPrefix { get { return Prefix; } } public GLXmlParser() { @@ -65,15 +61,19 @@ namespace OpenTK.Convert var version = (e.Attribute("version") ?? new XAttribute("version", String.Empty)).Value; var key = name + version; if (!elements.ContainsKey(key)) + { elements.Add(key, e); + } else + { elements[key].Add(e.Elements()); + } } - + return elements.Values; } - static string[] GetApiNames(XElement feature) + private static string[] GetApiNames(XElement feature) { string[] apinames = null; switch (feature.Name.LocalName) @@ -111,7 +111,7 @@ namespace OpenTK.Convert return apinames; } - IEnumerable ParseEnums(XDocument input) + private IEnumerable ParseEnums(XDocument input) { var features = input.Root.Elements("feature"); var extensions = input.Root.Elements("extensions").Elements("extension"); @@ -128,7 +128,9 @@ namespace OpenTK.Convert { var api = (e.Attribute("api") ?? new XAttribute("api", "default")).Value; if (!enums.ContainsKey(api)) + { enums.Add(api, new SortedDictionary()); + } enums[api].Add( TrimName(e.Attribute("name").Value), @@ -155,12 +157,14 @@ namespace OpenTK.Convert { var key = apiname + version; if (!APIs.ContainsKey(key)) + { APIs.Add( key, new XElement( "api", new XAttribute("name", apiname), String.IsNullOrEmpty(version) ? null : new XAttribute("version", version))); + } var api = APIs[key]; var enum_name = TrimName(feature.Attribute("name").Value); @@ -228,7 +232,7 @@ namespace OpenTK.Convert return APIs.Values; } - IEnumerable ParseFunctions(XDocument input) + private IEnumerable ParseFunctions(XDocument input) { // Go through the list of commands and build OpenTK functions out of those. // Every function has a number of attributes that define which API version and @@ -256,7 +260,7 @@ namespace OpenTK.Convert { var category = TrimName(feature.Attribute("name").Value); var apinames = GetApiNames(feature); - + var version = (feature.Attribute("number") != null ? feature.Attribute("number").Value : "") .Split('|'); @@ -271,12 +275,14 @@ namespace OpenTK.Convert var key = apiname + cmd_version; if (!APIs.ContainsKey(key)) + { APIs.Add( key, new XElement( - "api", - new XAttribute("name", apiname), - new XAttribute("version", cmd_version))); + "api", + new XAttribute("name", apiname), + new XAttribute("version", cmd_version))); + } var api = APIs[key]; foreach (var command in feature.Elements("require").Elements("command")) @@ -286,13 +292,17 @@ namespace OpenTK.Convert ExtensionRegex.Match(cmd_name).Value ?? (feature.Name == "extension" ? category.Substring(0, category.IndexOf("_")) : "Core"); if (String.IsNullOrEmpty(cmd_extension)) + { cmd_extension = "Core"; + } XElement function = TranslateCommand(commands[cmd_name]); function.Add(new XAttribute("category", cmd_category)); function.Add(new XAttribute("extension", cmd_extension)); if (!String.IsNullOrEmpty(cmd_version)) + { function.Add(new XAttribute("version", cmd_version)); + } Merge(api, function); } @@ -349,8 +359,9 @@ namespace OpenTK.Convert // Sanity check: one function cannot belong to two different extensions if (f.Attribute("extension").Value != function.Attribute("extension").Value) + { throw new InvalidOperationException("Different extensions for the same function"); - + } } else { @@ -408,19 +419,19 @@ namespace OpenTK.Convert return function; } - string FunctionName(XElement e) + private string FunctionName(XElement e) { return TrimName(e.Element("proto").Element("name").Value); } - string FunctionParameterType(XElement e) + private string FunctionParameterType(XElement e) { // Parse the C-like element. Possible instances: // Return types: // - void glGetSharpenTexFuncSGIS // -> void // - const GLubyte *glGetString - // -> String + // -> String // Note: group attribute takes precedence if it exists. This matches the old .spec file format. // Parameter types: // - GLenum shadertype @@ -438,9 +449,13 @@ namespace OpenTK.Convert { var words = ret.Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); if (words[0] == "struct" || words[0] == "const") + { words[1] = group.Value; + } else + { words[0] = group.Value; + } ret = String.Join(" ", words); } @@ -448,29 +463,27 @@ namespace OpenTK.Convert return ret; } - string TrimName(string name) - { - if (name.StartsWith(EnumPrefix)) - return name.Remove(0, EnumPrefix.Length); - else if (name.StartsWith(FuncPrefix)) - return name.Remove(0, FuncPrefix.Length); - else - return name; - } - - static string Join(string left, string right) + private static string Join(string left, string right) { if (!String.IsNullOrEmpty(left) && !String.IsNullOrEmpty(right)) + { return left + "|" + right; + } else if (!String.IsNullOrEmpty(left)) + { return left; + } else if (!String.IsNullOrEmpty(right)) + { return right; + } else + { return String.Empty; + } } - static XAttribute Lookup(IDictionary categories, string cmd_name, string attribute) + private static XAttribute Lookup(IDictionary categories, string cmd_name, string attribute) { if (categories.ContainsKey(cmd_name)) { diff --git a/src/Generator.Converter/Generator.Convert.csproj b/src/Generator.Converter/Generator.Convert.csproj index 871b3d6e..91a56148 100644 --- a/src/Generator.Converter/Generator.Convert.csproj +++ b/src/Generator.Converter/Generator.Convert.csproj @@ -14,7 +14,7 @@ Grid IE50 false - v3.5 + v4.6.1 Exe @@ -39,12 +39,16 @@ 1.0.0.%2a false true + true + true + ..\..\stylecop.ruleset 285212672 DEBUG;TRACE; + bin\Debug\Convert.xml True 4096 False @@ -52,7 +56,6 @@ False False 4 - AllRules.ruleset full -p:gl -v:4.5 -t:xml -o:../../../Source/Bind/Specifications/GL2/signatures.xml https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/api/gl.xml @@ -61,13 +64,13 @@ TRACE; + bin\Release\Convert.xml 4096 True bin\Release\ False False 4 - AllRules.ruleset none @@ -94,10 +97,8 @@ Code - - Code - - + + Code @@ -109,10 +110,17 @@ - - + + + + stylecop.json + + + stylecop.ruleset + + @@ -120,4 +128,600 @@ + + + + + ..\..\packages\CommandLineParser\lib\net40\CommandLine.dll + True + True + + + + + + + ..\..\packages\CommandLineParser\lib\net45\CommandLine.dll + True + True + + + + + + + ..\..\packages\CommandLineParser\lib\netstandard1.5\CommandLine.dll + True + True + + + + + + + True + + + True + + + + + + + ..\..\packages\System.Collections\ref\netstandard1.0\System.Collections.dll + False + True + + + + + + + ..\..\packages\System.Collections\ref\netstandard1.3\System.Collections.dll + False + True + + + + + + + + + True + + + ..\..\packages\System.Console\lib\net46\System.Console.dll + True + True + + + + + + + ..\..\packages\System.Console\ref\netstandard1.3\System.Console.dll + False + True + + + + + + + + + ..\..\packages\System.Diagnostics.Debug\ref\netstandard1.0\System.Diagnostics.Debug.dll + False + True + + + + + + + ..\..\packages\System.Diagnostics.Debug\ref\netstandard1.3\System.Diagnostics.Debug.dll + False + True + + + + + + + + + ..\..\packages\System.Globalization\ref\netstandard1.0\System.Globalization.dll + False + True + + + + + + + ..\..\packages\System.Globalization\ref\netstandard1.3\System.Globalization.dll + False + True + + + + + + + + + ..\..\packages\System.IO\lib\net462\System.IO.dll + True + True + + + + + + + ..\..\packages\System.IO\ref\netstandard1.0\System.IO.dll + False + True + + + + + + + ..\..\packages\System.IO\ref\netstandard1.3\System.IO.dll + False + True + + + + + + + ..\..\packages\System.IO\ref\netstandard1.5\System.IO.dll + False + True + + + + + + + + + ..\..\packages\System.Linq\lib\net463\System.Linq.dll + True + True + + + + + + + ..\..\packages\System.Linq\ref\netstandard1.0\System.Linq.dll + False + True + + + + + + + ..\..\packages\System.Linq\lib\netstandard1.6\System.Linq.dll + True + True + + + + + + + ..\..\packages\System.Linq\ref\netstandard1.6\System.Linq.dll + False + True + + + + + + + + + ..\..\packages\System.Linq.Expressions\lib\net463\System.Linq.Expressions.dll + True + True + + + + + + + ..\..\packages\System.Linq.Expressions\ref\netstandard1.0\System.Linq.Expressions.dll + False + True + + + + + + + ..\..\packages\System.Linq.Expressions\ref\netstandard1.3\System.Linq.Expressions.dll + False + True + + + + + + + ..\..\packages\System.Linq.Expressions\lib\netstandard1.6\System.Linq.Expressions.dll + True + True + + + + + + + ..\..\packages\System.Linq.Expressions\ref\netstandard1.6\System.Linq.Expressions.dll + False + True + + + + + + + + + ..\..\packages\System.ObjectModel\ref\netstandard1.0\System.ObjectModel.dll + False + True + + + + + + + ..\..\packages\System.ObjectModel\lib\netstandard1.3\System.ObjectModel.dll + True + True + + + + + + + ..\..\packages\System.ObjectModel\ref\netstandard1.3\System.ObjectModel.dll + False + True + + + + + + + + + ..\..\packages\System.Reflection\lib\net462\System.Reflection.dll + True + True + + + + + + + ..\..\packages\System.Reflection\ref\netstandard1.0\System.Reflection.dll + False + True + + + + + + + ..\..\packages\System.Reflection\ref\netstandard1.3\System.Reflection.dll + False + True + + + + + + + ..\..\packages\System.Reflection\ref\netstandard1.5\System.Reflection.dll + False + True + + + + + + + + + ..\..\packages\System.Reflection.Emit\ref\netstandard1.1\System.Reflection.Emit.dll + False + True + + + + + + + ..\..\packages\System.Reflection.Emit\lib\netstandard1.3\System.Reflection.Emit.dll + True + True + + + + + + + + + ..\..\packages\System.Reflection.Emit.ILGeneration\ref\netstandard1.0\System.Reflection.Emit.ILGeneration.dll + False + True + + + + + + + ..\..\packages\System.Reflection.Emit.ILGeneration\lib\netstandard1.3\System.Reflection.Emit.ILGeneration.dll + True + True + + + + + + + + + ..\..\packages\System.Reflection.Emit.Lightweight\ref\netstandard1.0\System.Reflection.Emit.Lightweight.dll + False + True + + + + + + + ..\..\packages\System.Reflection.Emit.Lightweight\lib\netstandard1.3\System.Reflection.Emit.Lightweight.dll + True + True + + + + + + + + + ..\..\packages\System.Reflection.Extensions\ref\netstandard1.0\System.Reflection.Extensions.dll + False + True + + + + + + + + + ..\..\packages\System.Reflection.Primitives\ref\netstandard1.0\System.Reflection.Primitives.dll + False + True + + + + + + + + + ..\..\packages\System.Reflection.TypeExtensions\lib\net462\System.Reflection.TypeExtensions.dll + True + True + + + + + + + ..\..\packages\System.Reflection.TypeExtensions\lib\netstandard1.5\System.Reflection.TypeExtensions.dll + True + True + + + + + + + ..\..\packages\System.Reflection.TypeExtensions\ref\netstandard1.5\System.Reflection.TypeExtensions.dll + False + True + + + + + + + + + ..\..\packages\System.Resources.ResourceManager\ref\netstandard1.0\System.Resources.ResourceManager.dll + False + True + + + + + + + + + True + + + + + + + True + + + ..\..\packages\System.Runtime\lib\net462\System.Runtime.dll + True + True + + + + + + + ..\..\packages\System.Runtime\ref\netstandard1.0\System.Runtime.dll + False + True + + + + + + + ..\..\packages\System.Runtime\ref\netstandard1.2\System.Runtime.dll + False + True + + + + + + + ..\..\packages\System.Runtime\ref\netstandard1.3\System.Runtime.dll + False + True + + + + + + + ..\..\packages\System.Runtime\ref\netstandard1.5\System.Runtime.dll + False + True + + + + + + + + + ..\..\packages\System.Runtime.Extensions\lib\net462\System.Runtime.Extensions.dll + True + True + + + + + + + ..\..\packages\System.Runtime.Extensions\ref\netstandard1.0\System.Runtime.Extensions.dll + False + True + + + + + + + ..\..\packages\System.Runtime.Extensions\ref\netstandard1.3\System.Runtime.Extensions.dll + False + True + + + + + + + ..\..\packages\System.Runtime.Extensions\ref\netstandard1.5\System.Runtime.Extensions.dll + False + True + + + + + + + + + ..\..\packages\System.Text.Encoding\ref\netstandard1.0\System.Text.Encoding.dll + False + True + + + + + + + ..\..\packages\System.Text.Encoding\ref\netstandard1.3\System.Text.Encoding.dll + False + True + + + + + + + + + ..\..\packages\System.Threading\ref\netstandard1.0\System.Threading.dll + False + True + + + + + + + ..\..\packages\System.Threading\lib\netstandard1.3\System.Threading.dll + True + True + + + + + + + ..\..\packages\System.Threading\ref\netstandard1.3\System.Threading.dll + False + True + + + + + + + + + ..\..\packages\System.Threading.Tasks\ref\netstandard1.0\System.Threading.Tasks.dll + False + True + + + + + + + ..\..\packages\System.Threading.Tasks\ref\netstandard1.3\System.Threading.Tasks.dll + False + True + + + + \ No newline at end of file diff --git a/src/Generator.Converter/Main.cs b/src/Generator.Converter/Main.cs index 6ccdb10d..addbe90d 100644 --- a/src/Generator.Converter/Main.cs +++ b/src/Generator.Converter/Main.cs @@ -8,10 +8,10 @@ // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: -// +// // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND @@ -28,11 +28,11 @@ using System.IO; using System.Linq; using System.Xml; using System.Xml.Linq; -using Mono.Options; +using CommandLine; namespace OpenTK.Convert { - class EnumTokenComparer : IEqualityComparer + internal class EnumTokenComparer : IEqualityComparer { public bool Equals(XNode a, XNode b) { @@ -59,51 +59,22 @@ namespace OpenTK.Convert } } } - - class EntryPoint + + internal class EntryPoint { - static void Main(string[] args) + private static Options CLIOptions; + + private static void Main(string[] args) { + Parser.Default.ParseArguments(args) + .WithParsed(result => CLIOptions = result) + .WithNotParsed(error => Environment.Exit(-1)); + try { - bool showHelp = false; - string prefix = "gl"; - string version = null; - string path = null; - OptionSet opts = new OptionSet - { - { "p=", "The {PREFIX} to remove from parsed functions and constants. " + - "Defaults to \"" + prefix + "\".", - v => prefix = v }, - { "v:", "The {VERSION} of the specification being parsed.", - v => version = v }, - { "o:", "The {PATH} to the output file.", - v => path = v }, - { "?|h|help", "Show this message and exit.", - v => showHelp = v != null }, - }; - var headers = opts.Parse(args); - var app = Path.GetFileName(Environment.GetCommandLineArgs()[0]); - if (showHelp) - { - Console.WriteLine("usage: {0} -p:PREFIX -v:VERSION SPECIFICATIONS", app); - Console.WriteLine(); - Console.WriteLine("Options:"); - opts.WriteOptionDescriptions(Console.Out); - Console.WriteLine(); - Console.WriteLine("SPECIFICATIONS are the Khronos XML files to parse into OpenTK XML."); - return; - } - if (prefix == null) - { - Console.WriteLine("{0}: missing required parameter -p.", app); - Console.WriteLine("Use '{0} --help' for usage.", app); - return; - } + XmlParser xmlParser = new GLXmlParser { Prefix = CLIOptions.Prefix }; - Parser parser = new GLXmlParser { Prefix = prefix, Version = version }; - - var sigs = headers.Select(h => parser.Parse(h)).ToList(); + var sigs = CLIOptions.InputFiles.Select(h => xmlParser.Parse(h)).ToList(); // Merge any duplicate enum entries (in case an enum is declared // in multiple files with different entries in each file). @@ -115,14 +86,14 @@ namespace OpenTK.Convert settings.Encoding = System.Text.Encoding.UTF8; TextWriter out_stream = null; - if (path == null) + if (CLIOptions.OutputFile == null) { out_stream = Console.Out; Console.OutputEncoding = System.Text.Encoding.UTF8; } else { - out_stream = new StreamWriter(path, false); + out_stream = new StreamWriter(CLIOptions.OutputFile, false); } using (var writer = XmlWriter.Create(out_stream, settings)) @@ -165,7 +136,9 @@ namespace OpenTK.Convert foreach (var e in entries) { if (e.Value.Name.LocalName != "enum") + { continue; + } var tokens = e.Value.Elements() .OrderBy(t => (string)t.Attribute("name")) .ToList(); diff --git a/src/Generator.Converter/Options.cs b/src/Generator.Converter/Options.cs index b22bd87a..cbafa080 100644 --- a/src/Generator.Converter/Options.cs +++ b/src/Generator.Converter/Options.cs @@ -1,1101 +1,58 @@ -// -// Options.cs -// -// Authors: -// Jonathan Pryor -// -// Copyright (C) 2008 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +using System.Collections.Generic; +using CommandLine; +using CommandLine.Text; -// Compile With: -// gmcs -debug+ -r:System.Core Options.cs -o:NDesk.Options.dll -// gmcs -debug+ -d:LINQ -r:System.Core Options.cs -o:NDesk.Options.dll -// -// The LINQ version just changes the implementation of -// OptionSet.Parse(IEnumerable), and confers no semantic changes. - -// -// A Getopt::Long-inspired option parsing library for C#. -// -// NDesk.Options.OptionSet is built upon a key/value table, where the -// key is a option format string and the value is a delegate that is -// invoked when the format string is matched. -// -// Option format strings: -// Regex-like BNF Grammar: -// name: .+ -// type: [=:] -// sep: ( [^{}]+ | '{' .+ '}' )? -// aliases: ( name type sep ) ( '|' name type sep )* -// -// Each '|'-delimited name is an alias for the associated action. If the -// format string ends in a '=', it has a required value. If the format -// string ends in a ':', it has an optional value. If neither '=' or ':' -// is present, no value is supported. `=' or `:' need only be defined on one -// alias, but if they are provided on more than one they must be consistent. -// -// Each alias portion may also end with a "key/value separator", which is used -// to split option values if the option accepts > 1 value. If not specified, -// it defaults to '=' and ':'. If specified, it can be any character except -// '{' and '}' OR the *string* between '{' and '}'. If no separator should be -// used (i.e. the separate values should be distinct arguments), then "{}" -// should be used as the separator. -// -// Options are extracted either from the current option by looking for -// the option name followed by an '=' or ':', or is taken from the -// following option IFF: -// - The current option does not contain a '=' or a ':' -// - The current option requires a value (i.e. not a Option type of ':') -// -// The `name' used in the option format string does NOT include any leading -// option indicator, such as '-', '--', or '/'. All three of these are -// permitted/required on any named option. -// -// Option bundling is permitted so long as: -// - '-' is used to start the option group -// - all of the bundled options are a single character -// - at most one of the bundled options accepts a value, and the value -// provided starts from the next character to the end of the string. -// -// This allows specifying '-a -b -c' as '-abc', and specifying '-D name=value' -// as '-Dname=value'. -// -// Option processing is disabled by specifying "--". All options after "--" -// are returned by OptionSet.Parse() unchanged and unprocessed. -// -// Unprocessed options are returned from OptionSet.Parse(). -// -// Examples: -// int verbose = 0; -// OptionSet p = new OptionSet () -// .Add ("v", v => ++verbose) -// .Add ("name=|value=", v => Console.WriteLine (v)); -// p.Parse (new string[]{"-v", "--v", "/v", "-name=A", "/name", "B", "extra"}); -// -// The above would parse the argument string array, and would invoke the -// lambda expression three times, setting `verbose' to 3 when complete. -// It would also print out "A" and "B" to standard output. -// The returned array would contain the string "extra". -// -// C# 3.0 collection initializers are supported and encouraged: -// var p = new OptionSet () { -// { "h|?|help", v => ShowHelp () }, -// }; -// -// System.ComponentModel.TypeConverter is also supported, allowing the use of -// custom data types in the callback type; TypeConverter.ConvertFromString() -// is used to convert the value option to an instance of the specified -// type: -// -// var p = new OptionSet () { -// { "foo=", (Foo f) => Console.WriteLine (f.ToString ()) }, -// }; -// -// Random other tidbits: -// - Boolean options (those w/o '=' or ':' in the option format string) -// are explicitly enabled if they are followed with '+', and explicitly -// disabled if they are followed with '-': -// string a = null; -// var p = new OptionSet () { -// { "a", s => a = s }, -// }; -// p.Parse (new string[]{"-a"}); // sets v != null -// p.Parse (new string[]{"-a+"}); // sets v != null -// p.Parse (new string[]{"-a-"}); // sets v == null -// - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Globalization; -using System.IO; -using System.Runtime.Serialization; -using System.Security.Permissions; -using System.Text; -using System.Text.RegularExpressions; - -#if LINQ -using System.Linq; -#endif - -#if TEST -using NDesk.Options; -#endif - -#if NDESK_OPTIONS -namespace NDesk.Options -#else -namespace Mono.Options -#endif +namespace OpenTK.Convert { - public class OptionValueCollection : IList, IList { - - List values = new List (); - OptionContext c; - - internal OptionValueCollection (OptionContext c) - { - this.c = c; - } - - #region ICollection - void ICollection.CopyTo (Array array, int index) {(values as ICollection).CopyTo (array, index);} - bool ICollection.IsSynchronized {get {return (values as ICollection).IsSynchronized;}} - object ICollection.SyncRoot {get {return (values as ICollection).SyncRoot;}} - #endregion - - #region ICollection - public void Add (string item) {values.Add (item);} - public void Clear () {values.Clear ();} - public bool Contains (string item) {return values.Contains (item);} - public void CopyTo (string[] array, int arrayIndex) {values.CopyTo (array, arrayIndex);} - public bool Remove (string item) {return values.Remove (item);} - public int Count {get {return values.Count;}} - public bool IsReadOnly {get {return false;}} - #endregion - - #region IEnumerable - IEnumerator IEnumerable.GetEnumerator () {return values.GetEnumerator ();} - #endregion - - #region IEnumerable - public IEnumerator GetEnumerator () {return values.GetEnumerator ();} - #endregion - - #region IList - int IList.Add (object value) {return (values as IList).Add (value);} - bool IList.Contains (object value) {return (values as IList).Contains (value);} - int IList.IndexOf (object value) {return (values as IList).IndexOf (value);} - void IList.Insert (int index, object value) {(values as IList).Insert (index, value);} - void IList.Remove (object value) {(values as IList).Remove (value);} - void IList.RemoveAt (int index) {(values as IList).RemoveAt (index);} - bool IList.IsFixedSize {get {return false;}} - object IList.this [int index] {get {return this [index];} set {(values as IList)[index] = value;}} - #endregion - - #region IList - public int IndexOf (string item) {return values.IndexOf (item);} - public void Insert (int index, string item) {values.Insert (index, item);} - public void RemoveAt (int index) {values.RemoveAt (index);} - - private void AssertValid (int index) - { - if (c.Option == null) - throw new InvalidOperationException ("OptionContext.Option is null."); - if (index >= c.Option.MaxValueCount) - throw new ArgumentOutOfRangeException ("index"); - if (c.Option.OptionValueType == OptionValueType.Required && - index >= values.Count) - throw new OptionException (string.Format ( - c.OptionSet.MessageLocalizer ("Missing required value for option '{0}'."), c.OptionName), - c.OptionName); - } - - public string this [int index] { - get { - AssertValid (index); - return index >= values.Count ? null : values [index]; - } - set { - values [index] = value; - } - } - #endregion - - public List ToList () - { - return new List (values); - } - - public string[] ToArray () - { - return values.ToArray (); - } - - public override string ToString () - { - return string.Join (", ", values.ToArray ()); - } - } - - public class OptionContext { - private Option option; - private string name; - private int index; - private OptionSet set; - private OptionValueCollection c; - - public OptionContext (OptionSet set) - { - this.set = set; - this.c = new OptionValueCollection (this); - } - - public Option Option { - get {return option;} - set {option = value;} - } - - public string OptionName { - get {return name;} - set {name = value;} - } - - public int OptionIndex { - get {return index;} - set {index = value;} - } - - public OptionSet OptionSet { - get {return set;} - } - - public OptionValueCollection OptionValues { - get {return c;} - } - } - - public enum OptionValueType { - None, - Optional, - Required, - } - - public abstract class Option { - string prototype, description; - string[] names; - OptionValueType type; - int count; - string[] separators; - - protected Option (string prototype, string description) - : this (prototype, description, 1) - { - } - - protected Option (string prototype, string description, int maxValueCount) - { - if (prototype == null) - throw new ArgumentNullException ("prototype"); - if (prototype.Length == 0) - throw new ArgumentException ("Cannot be the empty string.", "prototype"); - if (maxValueCount < 0) - throw new ArgumentOutOfRangeException ("maxValueCount"); - - this.prototype = prototype; - this.names = prototype.Split ('|'); - this.description = description; - this.count = maxValueCount; - this.type = ParsePrototype (); - - if (this.count == 0 && type != OptionValueType.None) - throw new ArgumentException ( - "Cannot provide maxValueCount of 0 for OptionValueType.Required or " + - "OptionValueType.Optional.", - "maxValueCount"); - if (this.type == OptionValueType.None && maxValueCount > 1) - throw new ArgumentException ( - string.Format ("Cannot provide maxValueCount of {0} for OptionValueType.None.", maxValueCount), - "maxValueCount"); - if (Array.IndexOf (names, "<>") >= 0 && - ((names.Length == 1 && this.type != OptionValueType.None) || - (names.Length > 1 && this.MaxValueCount > 1))) - throw new ArgumentException ( - "The default option handler '<>' cannot require values.", - "prototype"); - } - - public string Prototype {get {return prototype;}} - public string Description {get {return description;}} - public OptionValueType OptionValueType {get {return type;}} - public int MaxValueCount {get {return count;}} - - public string[] GetNames () - { - return (string[]) names.Clone (); - } - - public string[] GetValueSeparators () - { - if (separators == null) - return new string [0]; - return (string[]) separators.Clone (); - } - - protected static T Parse (string value, OptionContext c) - { - Type tt = typeof (T); - bool nullable = tt.IsValueType && tt.IsGenericType && - !tt.IsGenericTypeDefinition && - tt.GetGenericTypeDefinition () == typeof (Nullable<>); - Type targetType = nullable ? tt.GetGenericArguments () [0] : typeof (T); - TypeConverter conv = TypeDescriptor.GetConverter (targetType); - T t = default (T); - try { - if (value != null) - t = (T) conv.ConvertFromString (value); - } - catch (Exception e) { - throw new OptionException ( - string.Format ( - c.OptionSet.MessageLocalizer ("Could not convert string `{0}' to type {1} for option `{2}'."), - value, targetType.Name, c.OptionName), - c.OptionName, e); - } - return t; - } - - internal string[] Names {get {return names;}} - internal string[] ValueSeparators {get {return separators;}} - - static readonly char[] NameTerminator = new char[]{'=', ':'}; - - private OptionValueType ParsePrototype () - { - char type = '\0'; - List seps = new List (); - for (int i = 0; i < names.Length; ++i) { - string name = names [i]; - if (name.Length == 0) - throw new ArgumentException ("Empty option names are not supported.", "prototype"); - - int end = name.IndexOfAny (NameTerminator); - if (end == -1) - continue; - names [i] = name.Substring (0, end); - if (type == '\0' || type == name [end]) - type = name [end]; - else - throw new ArgumentException ( - string.Format ("Conflicting option types: '{0}' vs. '{1}'.", type, name [end]), - "prototype"); - AddSeparators (name, end, seps); - } - - if (type == '\0') - return OptionValueType.None; - - if (count <= 1 && seps.Count != 0) - throw new ArgumentException ( - string.Format ("Cannot provide key/value separators for Options taking {0} value(s).", count), - "prototype"); - if (count > 1) { - if (seps.Count == 0) - this.separators = new string[]{":", "="}; - else if (seps.Count == 1 && seps [0].Length == 0) - this.separators = null; - else - this.separators = seps.ToArray (); - } - - return type == '=' ? OptionValueType.Required : OptionValueType.Optional; - } - - private static void AddSeparators (string name, int end, ICollection seps) - { - int start = -1; - for (int i = end+1; i < name.Length; ++i) { - switch (name [i]) { - case '{': - if (start != -1) - throw new ArgumentException ( - string.Format ("Ill-formed name/value separator found in \"{0}\".", name), - "prototype"); - start = i+1; - break; - case '}': - if (start == -1) - throw new ArgumentException ( - string.Format ("Ill-formed name/value separator found in \"{0}\".", name), - "prototype"); - seps.Add (name.Substring (start, i-start)); - start = -1; - break; - default: - if (start == -1) - seps.Add (name [i].ToString ()); - break; - } - } - if (start != -1) - throw new ArgumentException ( - string.Format ("Ill-formed name/value separator found in \"{0}\".", name), - "prototype"); - } - - public void Invoke (OptionContext c) - { - OnParseComplete (c); - c.OptionName = null; - c.Option = null; - c.OptionValues.Clear (); - } - - protected abstract void OnParseComplete (OptionContext c); - - public override string ToString () - { - return Prototype; - } - } - - [Serializable] - public class OptionException : Exception { - private string option; - - public OptionException () - { - } - - public OptionException (string message, string optionName) - : base (message) - { - this.option = optionName; - } - - public OptionException (string message, string optionName, Exception innerException) - : base (message, innerException) - { - this.option = optionName; - } - - protected OptionException (SerializationInfo info, StreamingContext context) - : base (info, context) - { - this.option = info.GetString ("OptionName"); - } - - public string OptionName { - get {return this.option;} - } - - [SecurityPermission (SecurityAction.LinkDemand, SerializationFormatter = true)] - public override void GetObjectData (SerializationInfo info, StreamingContext context) - { - base.GetObjectData (info, context); - info.AddValue ("OptionName", option); - } - } - - public delegate void OptionAction (TKey key, TValue value); - - public class OptionSet : KeyedCollection - { - public OptionSet () - : this (delegate (string f) {return f;}) - { - } - - public OptionSet (Converter localizer) - { - this.localizer = localizer; - } - - Converter localizer; - - public Converter MessageLocalizer { - get {return localizer;} - } - - protected override string GetKeyForItem (Option item) - { - if (item == null) - throw new ArgumentNullException ("option"); - if (item.Names != null && item.Names.Length > 0) - return item.Names [0]; - // This should never happen, as it's invalid for Option to be - // constructed w/o any names. - throw new InvalidOperationException ("Option has no names!"); - } - - [Obsolete ("Use KeyedCollection.this[string]")] - protected Option GetOptionForName (string option) - { - if (option == null) - throw new ArgumentNullException ("option"); - try { - return base [option]; - } - catch (KeyNotFoundException) { - return null; - } - } - - protected override void InsertItem (int index, Option item) - { - base.InsertItem (index, item); - AddImpl (item); - } - - protected override void RemoveItem (int index) - { - base.RemoveItem (index); - Option p = Items [index]; - // KeyedCollection.RemoveItem() handles the 0th item - for (int i = 1; i < p.Names.Length; ++i) { - Dictionary.Remove (p.Names [i]); - } - } - - protected override void SetItem (int index, Option item) - { - base.SetItem (index, item); - RemoveItem (index); - AddImpl (item); - } - - private void AddImpl (Option option) - { - if (option == null) - throw new ArgumentNullException ("option"); - List added = new List (option.Names.Length); - try { - // KeyedCollection.InsertItem/SetItem handle the 0th name. - for (int i = 1; i < option.Names.Length; ++i) { - Dictionary.Add (option.Names [i], option); - added.Add (option.Names [i]); - } - } - catch (Exception) { - foreach (string name in added) - Dictionary.Remove (name); - throw; - } - } - - public new OptionSet Add (Option option) - { - base.Add (option); - return this; - } - - sealed class ActionOption : Option { - Action action; - - public ActionOption (string prototype, string description, int count, Action action) - : base (prototype, description, count) - { - if (action == null) - throw new ArgumentNullException ("action"); - this.action = action; - } - - protected override void OnParseComplete (OptionContext c) - { - action (c.OptionValues); - } - } - - public OptionSet Add (string prototype, Action action) - { - return Add (prototype, null, action); - } - - public OptionSet Add (string prototype, string description, Action action) - { - if (action == null) - throw new ArgumentNullException ("action"); - Option p = new ActionOption (prototype, description, 1, - delegate (OptionValueCollection v) { action (v [0]); }); - base.Add (p); - return this; - } - - public OptionSet Add (string prototype, OptionAction action) - { - return Add (prototype, null, action); - } - - public OptionSet Add (string prototype, string description, OptionAction action) - { - if (action == null) - throw new ArgumentNullException ("action"); - Option p = new ActionOption (prototype, description, 2, - delegate (OptionValueCollection v) {action (v [0], v [1]);}); - base.Add (p); - return this; - } - - sealed class ActionOption : Option { - Action action; - - public ActionOption (string prototype, string description, Action action) - : base (prototype, description, 1) - { - if (action == null) - throw new ArgumentNullException ("action"); - this.action = action; - } - - protected override void OnParseComplete (OptionContext c) - { - action (Parse (c.OptionValues [0], c)); - } - } - - sealed class ActionOption : Option { - OptionAction action; - - public ActionOption (string prototype, string description, OptionAction action) - : base (prototype, description, 2) - { - if (action == null) - throw new ArgumentNullException ("action"); - this.action = action; - } - - protected override void OnParseComplete (OptionContext c) - { - action ( - Parse (c.OptionValues [0], c), - Parse (c.OptionValues [1], c)); - } - } - - public OptionSet Add (string prototype, Action action) - { - return Add (prototype, null, action); - } - - public OptionSet Add (string prototype, string description, Action action) - { - return Add (new ActionOption (prototype, description, action)); - } - - public OptionSet Add (string prototype, OptionAction action) - { - return Add (prototype, null, action); - } - - public OptionSet Add (string prototype, string description, OptionAction action) - { - return Add (new ActionOption (prototype, description, action)); - } - - protected virtual OptionContext CreateOptionContext () - { - return new OptionContext (this); - } - -#if LINQ - public List Parse (IEnumerable arguments) - { - bool process = true; - OptionContext c = CreateOptionContext (); - c.OptionIndex = -1; - var def = GetOptionForName ("<>"); - var unprocessed = - from argument in arguments - where ++c.OptionIndex >= 0 && (process || def != null) - ? process - ? argument == "--" - ? (process = false) - : !Parse (argument, c) - ? def != null - ? Unprocessed (null, def, c, argument) - : true - : false - : def != null - ? Unprocessed (null, def, c, argument) - : true - : true - select argument; - List r = unprocessed.ToList (); - if (c.Option != null) - c.Option.Invoke (c); - return r; - } -#else - public List Parse (IEnumerable arguments) - { - OptionContext c = CreateOptionContext (); - c.OptionIndex = -1; - bool process = true; - List unprocessed = new List (); - Option def = Contains ("<>") ? this ["<>"] : null; - foreach (string argument in arguments) { - ++c.OptionIndex; - if (argument == "--") { - process = false; - continue; - } - if (!process) { - Unprocessed (unprocessed, def, c, argument); - continue; - } - if (!Parse (argument, c)) - Unprocessed (unprocessed, def, c, argument); - } - if (c.Option != null) - c.Option.Invoke (c); - return unprocessed; - } -#endif - - private static bool Unprocessed (ICollection extra, Option def, OptionContext c, string argument) - { - if (def == null) { - extra.Add (argument); - return false; - } - c.OptionValues.Add (argument); - c.Option = def; - c.Option.Invoke (c); - return false; - } - - private readonly Regex ValueOption = new Regex ( - @"^(?--|-|/)(?[^:=]+)((?[:=])(?.*))?$"); - - protected bool GetOptionParts (string argument, out string flag, out string name, out string sep, out string value) - { - if (argument == null) - throw new ArgumentNullException ("argument"); - - flag = name = sep = value = null; - Match m = ValueOption.Match (argument); - if (!m.Success) { - return false; - } - flag = m.Groups ["flag"].Value; - name = m.Groups ["name"].Value; - if (m.Groups ["sep"].Success && m.Groups ["value"].Success) { - sep = m.Groups ["sep"].Value; - value = m.Groups ["value"].Value; - } - return true; - } - - protected virtual bool Parse (string argument, OptionContext c) - { - if (c.Option != null) { - ParseValue (argument, c); - return true; - } - - string f, n, s, v; - if (!GetOptionParts (argument, out f, out n, out s, out v)) - return false; - - Option p; - if (Contains (n)) { - p = this [n]; - c.OptionName = f + n; - c.Option = p; - switch (p.OptionValueType) { - case OptionValueType.None: - c.OptionValues.Add (n); - c.Option.Invoke (c); - break; - case OptionValueType.Optional: - case OptionValueType.Required: - ParseValue (v, c); - break; - } - return true; - } - // no match; is it a bool option? - if (ParseBool (argument, n, c)) - return true; - // is it a bundled option? - if (ParseBundledValue (f, string.Concat (n + s + v), c)) - return true; - - return false; - } - - private void ParseValue (string option, OptionContext c) - { - if (option != null) - foreach (string o in c.Option.ValueSeparators != null - ? option.Split (c.Option.ValueSeparators, StringSplitOptions.None) - : new string[]{option}) { - c.OptionValues.Add (o); - } - if (c.OptionValues.Count == c.Option.MaxValueCount || - c.Option.OptionValueType == OptionValueType.Optional) - c.Option.Invoke (c); - else if (c.OptionValues.Count > c.Option.MaxValueCount) { - throw new OptionException (localizer (string.Format ( - "Error: Found {0} option values when expecting {1}.", - c.OptionValues.Count, c.Option.MaxValueCount)), - c.OptionName); - } - } - - private bool ParseBool (string option, string n, OptionContext c) - { - Option p; - string rn; - if (n.Length >= 1 && (n [n.Length-1] == '+' || n [n.Length-1] == '-') && - Contains ((rn = n.Substring (0, n.Length-1)))) { - p = this [rn]; - string v = n [n.Length-1] == '+' ? option : null; - c.OptionName = option; - c.Option = p; - c.OptionValues.Add (v); - p.Invoke (c); - return true; - } - return false; - } - - private bool ParseBundledValue (string f, string n, OptionContext c) - { - if (f != "-") - return false; - for (int i = 0; i < n.Length; ++i) { - Option p; - string opt = f + n [i].ToString (); - string rn = n [i].ToString (); - if (!Contains (rn)) { - if (i == 0) - return false; - throw new OptionException (string.Format (localizer ( - "Cannot bundle unregistered option '{0}'."), opt), opt); - } - p = this [rn]; - switch (p.OptionValueType) { - case OptionValueType.None: - Invoke (c, opt, n, p); - break; - case OptionValueType.Optional: - case OptionValueType.Required: { - string v = n.Substring (i+1); - c.Option = p; - c.OptionName = opt; - ParseValue (v.Length != 0 ? v : null, c); - return true; - } - default: - throw new InvalidOperationException ("Unknown OptionValueType: " + p.OptionValueType); - } - } - return true; - } - - private static void Invoke (OptionContext c, string name, string value, Option option) - { - c.OptionName = name; - c.Option = option; - c.OptionValues.Add (value); - option.Invoke (c); - } - - private const int OptionWidth = 29; - - public void WriteOptionDescriptions (TextWriter o) - { - foreach (Option p in this) { - int written = 0; - if (!WriteOptionPrototype (o, p, ref written)) - continue; - - if (written < OptionWidth) - o.Write (new string (' ', OptionWidth - written)); - else { - o.WriteLine (); - o.Write (new string (' ', OptionWidth)); - } - - bool indent = false; - string prefix = new string (' ', OptionWidth+2); - foreach (string line in GetLines (localizer (GetDescription (p.Description)))) { - if (indent) - o.Write (prefix); - o.WriteLine (line); - indent = true; - } - } - } - - bool WriteOptionPrototype (TextWriter o, Option p, ref int written) - { - string[] names = p.Names; - - int i = GetNextOptionIndex (names, 0); - if (i == names.Length) - return false; - - if (names [i].Length == 1) { - Write (o, ref written, " -"); - Write (o, ref written, names [0]); - } - else { - Write (o, ref written, " --"); - Write (o, ref written, names [0]); - } - - for ( i = GetNextOptionIndex (names, i+1); - i < names.Length; i = GetNextOptionIndex (names, i+1)) { - Write (o, ref written, ", "); - Write (o, ref written, names [i].Length == 1 ? "-" : "--"); - Write (o, ref written, names [i]); - } - - if (p.OptionValueType == OptionValueType.Optional || - p.OptionValueType == OptionValueType.Required) { - if (p.OptionValueType == OptionValueType.Optional) { - Write (o, ref written, localizer ("[")); - } - Write (o, ref written, localizer ("=" + GetArgumentName (0, p.MaxValueCount, p.Description))); - string sep = p.ValueSeparators != null && p.ValueSeparators.Length > 0 - ? p.ValueSeparators [0] - : " "; - for (int c = 1; c < p.MaxValueCount; ++c) { - Write (o, ref written, localizer (sep + GetArgumentName (c, p.MaxValueCount, p.Description))); - } - if (p.OptionValueType == OptionValueType.Optional) { - Write (o, ref written, localizer ("]")); - } - } - return true; - } - - static int GetNextOptionIndex (string[] names, int i) - { - while (i < names.Length && names [i] == "<>") { - ++i; - } - return i; - } - - static void Write (TextWriter o, ref int n, string s) - { - n += s.Length; - o.Write (s); - } - - private static string GetArgumentName (int index, int maxIndex, string description) - { - if (description == null) - return maxIndex == 1 ? "VALUE" : "VALUE" + (index + 1); - string[] nameStart; - if (maxIndex == 1) - nameStart = new string[]{"{0:", "{"}; - else - nameStart = new string[]{"{" + index + ":"}; - for (int i = 0; i < nameStart.Length; ++i) { - int start, j = 0; - do { - start = description.IndexOf (nameStart [i], j); - } while (start >= 0 && j != 0 ? description [j++ - 1] == '{' : false); - if (start == -1) - continue; - int end = description.IndexOf ("}", start); - if (end == -1) - continue; - return description.Substring (start + nameStart [i].Length, end - start - nameStart [i].Length); - } - return maxIndex == 1 ? "VALUE" : "VALUE" + (index + 1); - } - - private static string GetDescription (string description) - { - if (description == null) - return string.Empty; - StringBuilder sb = new StringBuilder (description.Length); - int start = -1; - for (int i = 0; i < description.Length; ++i) { - switch (description [i]) { - case '{': - if (i == start) { - sb.Append ('{'); - start = -1; - } - else if (start < 0) - start = i + 1; - break; - case '}': - if (start < 0) { - if ((i+1) == description.Length || description [i+1] != '}') - throw new InvalidOperationException ("Invalid option description: " + description); - ++i; - sb.Append ("}"); - } - else { - sb.Append (description.Substring (start, i - start)); - start = -1; - } - break; - case ':': - if (start < 0) - goto default; - start = i + 1; - break; - default: - if (start < 0) - sb.Append (description [i]); - break; - } - } - return sb.ToString (); - } - - private static IEnumerable GetLines (string description) - { - if (string.IsNullOrEmpty (description)) { - yield return string.Empty; - yield break; - } - int length = 80 - OptionWidth - 1; - int start = 0, end; - do { - end = GetLineEnd (start, length, description); - char c = description [end-1]; - if (char.IsWhiteSpace (c)) - --end; - bool writeContinuation = end != description.Length && !IsEolChar (c); - string line = description.Substring (start, end - start) + - (writeContinuation ? "-" : ""); - yield return line; - start = end; - if (char.IsWhiteSpace (c)) - ++start; - length = 80 - OptionWidth - 2 - 1; - } while (end < description.Length); - } - - private static bool IsEolChar (char c) - { - return !char.IsLetterOrDigit (c); - } - - private static int GetLineEnd (int start, int length, string description) - { - int end = System.Math.Min (start + length, description.Length); - int sep = -1; - for (int i = start; i < end; ++i) { - if (description [i] == '\n') - return i+1; - if (IsEolChar (description [i])) - sep = i+1; - } - if (sep == -1 || end == description.Length) - return end; - return sep; - } - } -} - + /// + /// A container class used by to parse command line arguments. + /// + public class Options + { + /// + /// Gets or sets the prefix to remove from parsed functions and constants. + /// + [Option('p', "prefix", + HelpText = "The prefix to remove from parsed functions and constants.", + Required = true, + Default = "gl")] + public string Prefix { get; set; } + + /// + /// Gets or sets the path to the output file. Defaults to stdout if no path is provided. + /// + [Option('o', "output-file", + HelpText = "The path to the output file. Defaults to stdout if no path is provided.")] + public string OutputFile { get; set; } + + /// + /// Gets or sets a list of the Khronos XML files to parse into OpenTK XML. Remote resources in the form of URLs are supported. + /// + [Option('i', "input-files", + HelpText = "A list of the Khronos XML files to parse into OpenTK XML. Remote resources in the form of URLs are supported.", + Required = true)] + public IEnumerable InputFiles { get; set; } + + /// + /// Gets a set of usage examples which can be shown to the user. + /// + [Usage(ApplicationAlias = "Convert.exe")] + public static IEnumerable Examples + { + get + { + yield return new Example + ( + "Converting local files", + new Options { Prefix = "gl", OutputFile = "signatures.xml", InputFiles = new []{ "gl.xml" } } + ); + + yield return new Example + ( + "Converting latest remote specification", + new Options { Prefix = "gl", OutputFile = "signatures.xml", InputFiles = new []{ "https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/api/gl.xml" } } + ); + } + } + } +} \ No newline at end of file diff --git a/src/Generator.Converter/Properties/AssemblyInfo.cs b/src/Generator.Converter/Properties/AssemblyInfo.cs index 9890a4ed..462df852 100644 --- a/src/Generator.Converter/Properties/AssemblyInfo.cs +++ b/src/Generator.Converter/Properties/AssemblyInfo.cs @@ -5,13 +5,18 @@ using System.Reflection; [assembly: AssemblyTitleAttribute("Generator.Convert")] [assembly: AssemblyProductAttribute("OpenTK")] [assembly: AssemblyDescriptionAttribute("A set of fast, low-level C# bindings for OpenGL, OpenGL ES and OpenAL.")] -[assembly: AssemblyVersionAttribute("2.0.0")] -[assembly: AssemblyFileVersionAttribute("2.0.0")] +[assembly: AssemblyVersionAttribute("3.0.0")] +[assembly: AssemblyFileVersionAttribute("3.0.0")] [assembly: CLSCompliantAttribute(true)] [assembly: AssemblyCopyrightAttribute("Copyright (c) 2006 - 2016 Stefanos Apostolopoulos for the Open Toolkit library.")] namespace System { internal static class AssemblyVersionInformation { - internal const string Version = "2.0.0"; - internal const string InformationalVersion = "2.0.0"; + internal const System.String AssemblyTitle = "Generator.Convert"; + internal const System.String AssemblyProduct = "OpenTK"; + internal const System.String AssemblyDescription = "A set of fast, low-level C# bindings for OpenGL, OpenGL ES and OpenAL."; + internal const System.String AssemblyVersion = "3.0.0"; + internal const System.String AssemblyFileVersion = "3.0.0"; + internal const System.Boolean CLSCompliant = true; + internal const System.String AssemblyCopyright = "Copyright (c) 2006 - 2016 Stefanos Apostolopoulos for the Open Toolkit library."; } } diff --git a/src/Generator.Converter/README.md b/src/Generator.Converter/README.md new file mode 100644 index 00000000..447ac58e --- /dev/null +++ b/src/Generator.Converter/README.md @@ -0,0 +1,24 @@ +### Introduction + +This is a simple tool to convert Khronos XML to OpenTK XML files. + +### Usage +``` +Converting local files: + Convert.exe --input-files gl.xml --output-file signatures.xml --prefix gl +Converting latest remote specification: + Convert.exe --input-files https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/api/gl.xml --output-file signatures.xml --prefix gl + + -p, --prefix Required. (Default: gl) The prefix to remove from parsed functions and constants. + + -o, --output-file The path to the output file. Defaults to stdout if no path is provided. + + -i, --input-files Required. A list of the Khronos XML files to parse into OpenTK XML. Remote resources in the form of URLs are supported. + + --help Display this help screen. + + --version Display version information. +``` +### Support + +If you encounter a bug, please file an issue report at the OpenTK [issue tracker](http://github.com/opentk/opentk/issues). \ No newline at end of file diff --git a/src/Generator.Converter/Readme.txt b/src/Generator.Converter/Readme.txt deleted file mode 100644 index 8b3ed08a..00000000 --- a/src/Generator.Converter/Readme.txt +++ /dev/null @@ -1,24 +0,0 @@ -[Introduction] - -This is a simple tool to convert Khronos XML to OpenTK XML files. - -[Examples] - -To download and convert the XML API registry from Khronos: -Convert.exe -p:gl -o:../../../Source/Bind/Specifications/GL2/signatures.xml https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/api/gl.xml - -The line above will download the latest .xml files from the public Khronos repository and update signatures.xml for the binding generator. - -[Usage] - -Convert.exe -p:{PREFIX} -v:{VERSION} -t:{TYPE} -o:{OUT} {INPUT1} ... {INPUTn} - {PREFIX} is a simple string that defines the a common prefix for functions and constants in this header. This prefix will be removed from the generated XML file. - {VERSION} is a string that defines that version that will be used for functions in the generated XML file. Specific input files may override this setting. - {OUT} is the output filename (optional). If no output file is specified, output will be directed to the console. - {INPUT1..n} is a space-separated list of input files. - -Despite what the help says, prefix and version parameters are necessary at the moment. - -[Support] - -If you encounter a bug, please file an issue report at http://github.com/opentk/opentk/issues \ No newline at end of file diff --git a/src/Generator.Converter/Parser.cs b/src/Generator.Converter/XmlParser.cs similarity index 84% rename from src/Generator.Converter/Parser.cs rename to src/Generator.Converter/XmlParser.cs index 6f955cae..b7e8ee25 100644 --- a/src/Generator.Converter/Parser.cs +++ b/src/Generator.Converter/XmlParser.cs @@ -8,10 +8,10 @@ // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: -// +// // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND @@ -29,13 +29,12 @@ using System.Xml.Linq; namespace OpenTK.Convert { // The base class for a parser. - abstract class Parser + internal abstract class XmlParser { // Defines a prefix that should be removed from methods and tokens in the XML files, e.g. "gl", "cl", etc. public string Prefix { get; set; } - - // Defines the version of the spec files (optional). - public string Version { get; set; } + public string EnumPrefix { get { return Prefix.ToUpper() + "_"; } } + public string FuncPrefix { get { return Prefix; } } // Implements the parsing logic for a specific input file. public abstract IEnumerable Parse(string[] lines); @@ -82,5 +81,21 @@ namespace OpenTK.Convert return Parse(contents); } + + public string TrimName(string name) + { + if (name.StartsWith(EnumPrefix)) + { + return name.Remove(0, EnumPrefix.Length); + } + else if (name.StartsWith(FuncPrefix)) + { + return name.Remove(0, FuncPrefix.Length); + } + else + { + return name; + } + } } } diff --git a/src/Generator.Converter/paket.references b/src/Generator.Converter/paket.references index e69de29b..a571b3b2 100644 --- a/src/Generator.Converter/paket.references +++ b/src/Generator.Converter/paket.references @@ -0,0 +1,2 @@ +CommandLineParser +StyleCop.Analyzers \ No newline at end of file diff --git a/src/Generator.Rewrite/CountAttribute.cs b/src/Generator.Rewrite/CountAttribute.cs new file mode 100644 index 00000000..bed2d5f4 --- /dev/null +++ b/src/Generator.Rewrite/CountAttribute.cs @@ -0,0 +1,10 @@ + +namespace OpenTK.Rewrite +{ + internal class CountAttribute + { + public int Count; + public string Parameter; + public string Computed; + } +} diff --git a/src/Generator.Rewrite/GeneratedVariableIdentifier.cs b/src/Generator.Rewrite/GeneratedVariableIdentifier.cs new file mode 100644 index 00000000..6f4e950e --- /dev/null +++ b/src/Generator.Rewrite/GeneratedVariableIdentifier.cs @@ -0,0 +1,56 @@ +using System; +using Mono.Cecil.Cil; + +namespace OpenTK.Rewrite +{ + /// + /// Acts as a unique identifier for a generated named variable that can be passed between methods. Replaces uses of + /// variable names from Mono.Cecil. + /// + internal sealed class GeneratedVariableIdentifier + { + /// + /// The which the variable is in. + /// + public MethodBody Body { get; } + + /// + /// The which the variable idetifier maps to. + /// + public VariableDefinition Definition { get; } + + /// + /// The name of the generated variable. + /// + public string Name { get; } + + /// + /// Initializes a new instance of the class. + /// + /// The method body which the variable is in. + /// The definition of the generated variable. + /// The name of the generated variable. + /// + public GeneratedVariableIdentifier(MethodBody body, VariableDefinition definition, string name) + { + if (body == null) + { + throw new ArgumentException("The body argument cannot be null.", nameof(body)); + } + + if (definition == null) + { + throw new ArgumentException("The definition argument cannot be null.", nameof(definition)); + } + + if (string.IsNullOrEmpty(name)) + { + throw new ArgumentException("The name argument cannot be null or empty", nameof(name)); + } + + this.Body = body; + this.Definition = definition; + this.Name = name; + } + } +} diff --git a/src/Generator.Rewrite/Generator.Rewrite.csproj b/src/Generator.Rewrite/Generator.Rewrite.csproj index a6472b87..38c3389a 100644 --- a/src/Generator.Rewrite/Generator.Rewrite.csproj +++ b/src/Generator.Rewrite/Generator.Rewrite.csproj @@ -9,10 +9,13 @@ Properties OpenTK.Rewrite Rewrite - v3.5 + v4.6.1 512 12.0.0 2.0 + true + true + ..\..\stylecop.ruleset AnyCPU @@ -21,9 +24,10 @@ false bin\Debug\ DEBUG;TRACE + bin\Debug\Rewrite.xml prompt 4 - ../../OpenTK/Debug/OpenTK.dll ../../../OpenTK.snk -debug + --assembly ../../OpenTK/Debug/OpenTK.dll --signing-key ../../../OpenTK.snk --debug AnyCPU @@ -31,9 +35,10 @@ true bin\Release\ TRACE + bin\Release\Rewrite.xml prompt 4 - ../../OpenTK/Release/OpenTK.dll ../../../OpenTK.snk + --assembly ../../OpenTK/Release/OpenTK.dll --signing-key ../../../OpenTK.snk true @@ -52,6 +57,9 @@ + + + @@ -61,8 +69,16 @@ + + + stylecop.json + + + stylecop.ruleset + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/OpenTK.Tests.Integration/App.config b/tests/OpenTK.Tests.Integration/App.config new file mode 100644 index 00000000..571e8b49 --- /dev/null +++ b/tests/OpenTK.Tests.Integration/App.config @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/OpenTK.Tests.Integration/AssemblyInfo.fs b/tests/OpenTK.Tests.Integration/AssemblyInfo.fs new file mode 100644 index 00000000..9aa700ce --- /dev/null +++ b/tests/OpenTK.Tests.Integration/AssemblyInfo.fs @@ -0,0 +1,41 @@ +namespace OpenTK.Tests.Integration.AssemblyInfo + +open System.Reflection +open System.Runtime.CompilerServices +open System.Runtime.InteropServices + +// 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. +[] +[] +[] +[] +[] +[] +[] +[] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [] +[] +[] + +do + () diff --git a/tests/OpenTK.Tests.Integration/GameWindowTests.fs b/tests/OpenTK.Tests.Integration/GameWindowTests.fs new file mode 100644 index 00000000..5b31a588 --- /dev/null +++ b/tests/OpenTK.Tests.Integration/GameWindowTests.fs @@ -0,0 +1,194 @@ +namespace OpenTK.Tests.Integration + +open Xunit +open FsCheck +open FsCheck.Xunit +open System +open System.Runtime.InteropServices +open OpenTK + +module GameWindow = + module General = + [] + let ``Can create and close GameWindow`` () = + use gw = new OpenTK.GameWindow() + gw.Close() + + [] + let ``Exit works like Close`` () = + use gw = new OpenTK.GameWindow() + gw.Exit() + + [] + let ``GameWindow exists after creation`` () = + use gw = new OpenTK.GameWindow() + Assert.True(gw.Exists) + gw.Exit() + + [] + let ``Can close GameWindow on UpdateFrame`` () = + use gw = new OpenTK.GameWindow() + gw.UpdateFrame.Add(fun _ -> gw.Close()) + gw.Run() + + [] + let ``Closing event is sent before closed`` () = + use gw = new OpenTK.GameWindow() + let signals = System.Collections.Generic.List() + gw.Closing.Add(fun _ -> signals.Add("Closing")) + gw.Closed.Add(fun _ -> signals.Add("Closed")) + gw.Close() + Assert.Equal([], signals) + gw.ProcessEvents() + Assert.Equal(["Closing"; "Closed"], signals) + + module Constructors = + [] + let ``Width and Height can be set via constructor`` () = + use gw = new OpenTK.GameWindow(200, 100) + Assert.Equal(200, gw.Width) + Assert.Equal(100, gw.Height) + + module Sizes = + [] + let ``Updates to Width take effect`` () = + use gw = new OpenTK.GameWindow() + let oldWidth = gw.Width + let newWidth = oldWidth + 1 + gw.Width <- newWidth + Assert.Equal(newWidth, gw.Width) + + [] + let ``Updates to Height take effect`` () = + use gw = new OpenTK.GameWindow() + let oldHeight = gw.Height + let newHeight = oldHeight + 1 + gw.Height <- newHeight + Assert.Equal(newHeight, gw.Height) + + [] + let ``Updates to Size take effect`` () = + use gw = new OpenTK.GameWindow() + let oldSize = gw.Size + let newSize = System.Drawing.Size(oldSize.Width + 1, oldSize.Height + 1) + gw.Size <- newSize + Assert.Equal(newSize, gw.Size) + + [] + let ``Updates to ClientSize take effect`` () = + use gw = new OpenTK.GameWindow() + let oldSize = gw.ClientSize + let newSize = System.Drawing.Size(oldSize.Width + 1, oldSize.Height + 1) + gw.ClientSize <- newSize + Assert.Equal(newSize, gw.ClientSize) + + [] + let ``Updates to ClientRectangle.Size take effect`` () = + use gw = new OpenTK.GameWindow() + let oldSize = gw.ClientRectangle.Size + let newSize = System.Drawing.Size(oldSize.Width + 1, oldSize.Height + 1) + let newRect = System.Drawing.Rectangle(gw.ClientRectangle.Location, newSize) + gw.ClientRectangle <- newRect + Assert.Equal(newRect, gw.ClientRectangle) + + [] + let ``Updates to Bounds.Size take effect`` () = + use gw = new OpenTK.GameWindow() + let oldSize = gw.Bounds.Size + let newSize = System.Drawing.Size(oldSize.Width + 1, oldSize.Height + 1) + let newRect = System.Drawing.Rectangle(gw.Bounds.Location, newSize) + gw.Bounds <- newRect + Assert.Equal(newRect, gw.Bounds) + + [] + let ``ClientSize equals ClientRectangle.Size`` () = + use gw = new OpenTK.GameWindow() + Assert.Equal(gw.ClientSize, gw.ClientRectangle.Size) + + [] + let ``Size equals Bounds.Size`` () = + use gw = new OpenTK.GameWindow() + Assert.Equal(gw.Size, gw.Bounds.Size) + + [] + let ``Width and Height equals ClientSize`` () = + use gw = new OpenTK.GameWindow() + Assert.Equal(System.Drawing.Size(gw.Width, gw.Height), gw.ClientSize) + + module Locations = + [] + let ``Updates to X take effect`` () = + use gw = new OpenTK.GameWindow() + let oldX = gw.X + let newX = oldX + 1 + gw.X <- newX + Assert.Equal(newX, gw.X) + + [] + let ``Updates to Y take effect`` () = + use gw = new OpenTK.GameWindow() + let oldY = gw.Y + let newY = oldY + 1 + gw.Y <- newY + Assert.Equal(newY, gw.Y) + + [] + let ``Updates to Location take effect`` () = + use gw = new OpenTK.GameWindow() + let oldLocation = gw.Location + let newLocation = System.Drawing.Point(oldLocation.X + 1, oldLocation.Y + 1) + gw.Location <- newLocation + Assert.Equal(newLocation, gw.Location) + + [] + let ``Updates to Bounds.Location take effect`` () = + use gw = new OpenTK.GameWindow() + let oldLocation = gw.Bounds.Location + let newLocation = System.Drawing.Point(oldLocation.X + 1, oldLocation.Y + 1) + let newRect = System.Drawing.Rectangle(newLocation, gw.ClientRectangle.Size) + gw.Bounds <- newRect + Assert.Equal(newRect, gw.Bounds) + + [] + let ``Location equals Bounds.Location`` () = + use gw = new OpenTK.GameWindow() + Assert.Equal(gw.Location, gw.Bounds.Location) + + [] + let ``X and Y equals Location`` () = + use gw = new OpenTK.GameWindow() + Assert.Equal(System.Drawing.Point(gw.X, gw.Y), gw.Location) + + [] + let ``ClientRectangle.Location is zero`` () = + use gw = new OpenTK.GameWindow() + Assert.Equal(System.Drawing.Point.Empty, gw.ClientRectangle.Location) + + module Borders = + [] + let ``Updates to BorderStyle take effect`` () = + use gw = new OpenTK.GameWindow() + gw.WindowBorder <- WindowBorder.Fixed + Assert.Equal(WindowBorder.Fixed, gw.WindowBorder) + gw.WindowBorder <- WindowBorder.Hidden + Assert.Equal(WindowBorder.Hidden, gw.WindowBorder) + gw.WindowBorder <- WindowBorder.Resizable + Assert.Equal(WindowBorder.Resizable, gw.WindowBorder) + + [] + let ``Can resize fixed borders`` () = + use gw = new OpenTK.GameWindow() + gw.WindowBorder <- WindowBorder.Fixed + let oldSize = gw.Size + let newSize = System.Drawing.Size(oldSize.Width + 1, oldSize.Height + 1) + gw.Size <- newSize + Assert.Equal(newSize, gw.Size) + + [] + let ``Can resize hidden borders`` () = + use gw = new OpenTK.GameWindow() + gw.WindowBorder <- WindowBorder.Hidden + let oldSize = gw.Size + let newSize = System.Drawing.Size(oldSize.Width + 1, oldSize.Height + 1) + gw.Size <- newSize + Assert.Equal(newSize, gw.Size) diff --git a/tests/OpenTK.Tests.Integration/OpenTK.Tests.Integration.fsproj b/tests/OpenTK.Tests.Integration/OpenTK.Tests.Integration.fsproj new file mode 100644 index 00000000..77e09d86 --- /dev/null +++ b/tests/OpenTK.Tests.Integration/OpenTK.Tests.Integration.fsproj @@ -0,0 +1,1678 @@ + + + + + Debug + AnyCPU + 2.0 + 522d9279-3ed6-475f-867a-6ae69a53c24a + Library + OpenTK.Tests.Integration + OpenTK.Tests.Integration + v4.5.2 + 4.4.0.0 + true + OpenTK.Tests.Integration + true + Program + packages\xunit.runner.console\tools\xunit.console.exe + OpenTK.Tests.Integration.dll + + + true + full + false + false + bin\Debug\ + DEBUG;TRACE + 3 + bin\Debug\OpenTK.Tests.Integration.XML + + + pdbonly + true + true + bin\Release\ + TRACE + 3 + bin\Release\OpenTK.Tests.Integration.XML + + + 11 + + + + + $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets + + + + + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets + + + + + + + + + + + + + + + + + + + OpenTK + {a37a7e14-0000-0000-0000-000000000000} + True + + + + + + + ..\..\packages\FsCheck\lib\net452\FsCheck.dll + True + True + + + + + + + ..\..\packages\FsCheck\lib\netstandard1.6\FsCheck.dll + True + True + + + + + + + ..\..\packages\FsCheck\lib\portable-net45+netcore45\FsCheck.dll + True + True + + + + + + + ..\..\packages\FsCheck\lib\portable-net45+netcore45+wp8\FsCheck.dll + True + True + + + + + + + ..\..\packages\FsCheck\lib\portable-net45+netcore45+wpa81+wp8\FsCheck.dll + True + True + + + + + + + + + ..\..\packages\FsCheck.Xunit\lib\net452\FsCheck.Xunit.dll + True + True + + + + + + + ..\..\packages\FsCheck.Xunit\lib\netstandard1.6\FsCheck.Xunit.dll + True + True + + + + + + + + + ..\..\packages\FSharp.Core\lib\net45\FSharp.Core.dll + True + True + + + + + + + ..\..\packages\FSharp.Core\lib\netstandard1.6\FSharp.Core.dll + True + True + + + + + + + + + ..\..\packages\Microsoft.Win32.Primitives\ref\netstandard1.3\Microsoft.Win32.Primitives.dll + False + True + + + + + + + + + ..\..\packages\System.AppContext\ref\netstandard1.3\System.AppContext.dll + False + True + + + + + + + ..\..\packages\System.AppContext\lib\netstandard1.6\System.AppContext.dll + True + True + + + + + + + ..\..\packages\System.AppContext\ref\netstandard1.6\System.AppContext.dll + False + True + + + + + + + + + ..\..\packages\System.Buffers\lib\netstandard1.1\System.Buffers.dll + True + True + + + + + + + + + ..\..\packages\System.Collections\ref\netstandard1.0\System.Collections.dll + False + True + + + + + + + ..\..\packages\System.Collections\ref\netstandard1.3\System.Collections.dll + False + True + + + + + + + + + ..\..\packages\System.Collections.Concurrent\ref\netstandard1.1\System.Collections.Concurrent.dll + False + True + + + + + + + ..\..\packages\System.Collections.Concurrent\lib\netstandard1.3\System.Collections.Concurrent.dll + True + True + + + + + + + ..\..\packages\System.Collections.Concurrent\ref\netstandard1.3\System.Collections.Concurrent.dll + False + True + + + + + + + + + ..\..\packages\System.Console\lib\net46\System.Console.dll + True + True + + + + + + + ..\..\packages\System.Console\ref\netstandard1.3\System.Console.dll + False + True + + + + + + + + + ..\..\packages\System.Diagnostics.Debug\ref\netstandard1.0\System.Diagnostics.Debug.dll + False + True + + + + + + + ..\..\packages\System.Diagnostics.Debug\ref\netstandard1.3\System.Diagnostics.Debug.dll + False + True + + + + + + + + + ..\..\packages\System.Diagnostics.DiagnosticSource\lib\netstandard1.3\System.Diagnostics.DiagnosticSource.dll + True + True + + + + + + + + + ..\..\packages\System.Diagnostics.Tools\ref\netstandard1.0\System.Diagnostics.Tools.dll + False + True + + + + + + + + + ..\..\packages\System.Diagnostics.Tracing\ref\netstandard1.1\System.Diagnostics.Tracing.dll + False + True + + + + + + + ..\..\packages\System.Diagnostics.Tracing\ref\netstandard1.2\System.Diagnostics.Tracing.dll + False + True + + + + + + + ..\..\packages\System.Diagnostics.Tracing\ref\netstandard1.3\System.Diagnostics.Tracing.dll + False + True + + + + + + + ..\..\packages\System.Diagnostics.Tracing\ref\netstandard1.5\System.Diagnostics.Tracing.dll + False + True + + + + + + + + + ..\..\packages\System.Globalization\ref\netstandard1.0\System.Globalization.dll + False + True + + + + + + + ..\..\packages\System.Globalization\ref\netstandard1.3\System.Globalization.dll + False + True + + + + + + + + + ..\..\packages\System.Globalization.Calendars\ref\netstandard1.3\System.Globalization.Calendars.dll + False + True + + + + + + + + + ..\..\packages\System.Globalization.Extensions\ref\netstandard1.3\System.Globalization.Extensions.dll + False + True + + + + + + + + + ..\..\packages\System.IO\lib\net462\System.IO.dll + True + True + + + + + + + ..\..\packages\System.IO\ref\netstandard1.0\System.IO.dll + False + True + + + + + + + ..\..\packages\System.IO\ref\netstandard1.3\System.IO.dll + False + True + + + + + + + ..\..\packages\System.IO\ref\netstandard1.5\System.IO.dll + False + True + + + + + + + + + True + + + + + + + True + + + + + + + True + + + + + + + ..\..\packages\System.IO.Compression\ref\netstandard1.1\System.IO.Compression.dll + False + True + + + + + + + ..\..\packages\System.IO.Compression\ref\netstandard1.3\System.IO.Compression.dll + False + True + + + + + + + True + + + + + + + True + + + + + + + True + + + + + + + True + + + + + + + + + ..\..\packages\System.IO.Compression.ZipFile\lib\netstandard1.3\System.IO.Compression.ZipFile.dll + True + True + + + + + + + ..\..\packages\System.IO.Compression.ZipFile\ref\netstandard1.3\System.IO.Compression.ZipFile.dll + False + True + + + + + + + + + ..\..\packages\System.IO.FileSystem\ref\netstandard1.3\System.IO.FileSystem.dll + False + True + + + + + + + + + ..\..\packages\System.IO.FileSystem.Primitives\lib\netstandard1.3\System.IO.FileSystem.Primitives.dll + True + True + + + + + + + ..\..\packages\System.IO.FileSystem.Primitives\ref\netstandard1.3\System.IO.FileSystem.Primitives.dll + False + True + + + + + + + + + ..\..\packages\System.Linq\lib\net463\System.Linq.dll + True + True + + + + + + + ..\..\packages\System.Linq\ref\netstandard1.0\System.Linq.dll + False + True + + + + + + + ..\..\packages\System.Linq\lib\netstandard1.6\System.Linq.dll + True + True + + + + + + + ..\..\packages\System.Linq\ref\netstandard1.6\System.Linq.dll + False + True + + + + + + + + + ..\..\packages\System.Linq.Expressions\lib\net463\System.Linq.Expressions.dll + True + True + + + + + + + ..\..\packages\System.Linq.Expressions\ref\netstandard1.0\System.Linq.Expressions.dll + False + True + + + + + + + ..\..\packages\System.Linq.Expressions\ref\netstandard1.3\System.Linq.Expressions.dll + False + True + + + + + + + ..\..\packages\System.Linq.Expressions\lib\netstandard1.6\System.Linq.Expressions.dll + True + True + + + + + + + ..\..\packages\System.Linq.Expressions\ref\netstandard1.6\System.Linq.Expressions.dll + False + True + + + + + + + + + ..\..\packages\System.Linq.Queryable\ref\netstandard1.0\System.Linq.Queryable.dll + False + True + + + + + + + ..\..\packages\System.Linq.Queryable\lib\netstandard1.3\System.Linq.Queryable.dll + True + True + + + + + + + + + True + + + + + + + True + + + + + + + True + + + + + + + True + + + + + + + ..\..\packages\System.Net.Http\ref\netstandard1.1\System.Net.Http.dll + False + True + + + + + + + ..\..\packages\System.Net.Http\ref\netstandard1.3\System.Net.Http.dll + False + True + + + + + + + True + + + + + + + True + + + + + + + True + + + + + + + + + ..\..\packages\System.Net.Primitives\ref\netstandard1.1\System.Net.Primitives.dll + False + True + + + + + + + ..\..\packages\System.Net.Primitives\ref\netstandard1.3\System.Net.Primitives.dll + False + True + + + + + + + + + ..\..\packages\System.Net.Requests\ref\netstandard1.3\System.Net.Requests.dll + False + True + + + + + + + + + ..\..\packages\System.Net.Sockets\ref\netstandard1.3\System.Net.Sockets.dll + False + True + + + + + + + + + ..\..\packages\System.Net.WebHeaderCollection\lib\netstandard1.3\System.Net.WebHeaderCollection.dll + True + True + + + + + + + ..\..\packages\System.Net.WebHeaderCollection\ref\netstandard1.3\System.Net.WebHeaderCollection.dll + False + True + + + + + + + + + ..\..\packages\System.ObjectModel\ref\netstandard1.0\System.ObjectModel.dll + False + True + + + + + + + ..\..\packages\System.ObjectModel\lib\netstandard1.3\System.ObjectModel.dll + True + True + + + + + + + ..\..\packages\System.ObjectModel\ref\netstandard1.3\System.ObjectModel.dll + False + True + + + + + + + + + ..\..\packages\System.Reflection\lib\net462\System.Reflection.dll + True + True + + + + + + + ..\..\packages\System.Reflection\ref\netstandard1.0\System.Reflection.dll + False + True + + + + + + + ..\..\packages\System.Reflection\ref\netstandard1.3\System.Reflection.dll + False + True + + + + + + + ..\..\packages\System.Reflection\ref\netstandard1.5\System.Reflection.dll + False + True + + + + + + + + + ..\..\packages\System.Reflection.Emit\ref\netstandard1.1\System.Reflection.Emit.dll + False + True + + + + + + + ..\..\packages\System.Reflection.Emit\lib\netstandard1.3\System.Reflection.Emit.dll + True + True + + + + + + + + + ..\..\packages\System.Reflection.Emit.ILGeneration\ref\netstandard1.0\System.Reflection.Emit.ILGeneration.dll + False + True + + + + + + + ..\..\packages\System.Reflection.Emit.ILGeneration\lib\netstandard1.3\System.Reflection.Emit.ILGeneration.dll + True + True + + + + + + + + + ..\..\packages\System.Reflection.Emit.Lightweight\ref\netstandard1.0\System.Reflection.Emit.Lightweight.dll + False + True + + + + + + + ..\..\packages\System.Reflection.Emit.Lightweight\lib\netstandard1.3\System.Reflection.Emit.Lightweight.dll + True + True + + + + + + + + + ..\..\packages\System.Reflection.Extensions\ref\netstandard1.0\System.Reflection.Extensions.dll + False + True + + + + + + + + + ..\..\packages\System.Reflection.Primitives\ref\netstandard1.0\System.Reflection.Primitives.dll + False + True + + + + + + + + + ..\..\packages\System.Reflection.TypeExtensions\lib\net462\System.Reflection.TypeExtensions.dll + True + True + + + + + + + ..\..\packages\System.Reflection.TypeExtensions\lib\netstandard1.5\System.Reflection.TypeExtensions.dll + True + True + + + + + + + ..\..\packages\System.Reflection.TypeExtensions\ref\netstandard1.5\System.Reflection.TypeExtensions.dll + False + True + + + + + + + + + ..\..\packages\System.Resources.ResourceManager\ref\netstandard1.0\System.Resources.ResourceManager.dll + False + True + + + + + + + + + True + + + + + + + True + + + ..\..\packages\System.Runtime\lib\net462\System.Runtime.dll + True + True + + + + + + + ..\..\packages\System.Runtime\ref\netstandard1.0\System.Runtime.dll + False + True + + + + + + + ..\..\packages\System.Runtime\ref\netstandard1.2\System.Runtime.dll + False + True + + + + + + + ..\..\packages\System.Runtime\ref\netstandard1.3\System.Runtime.dll + False + True + + + + + + + ..\..\packages\System.Runtime\ref\netstandard1.5\System.Runtime.dll + False + True + + + + + + + + + ..\..\packages\System.Runtime.Extensions\lib\net462\System.Runtime.Extensions.dll + True + True + + + + + + + ..\..\packages\System.Runtime.Extensions\ref\netstandard1.0\System.Runtime.Extensions.dll + False + True + + + + + + + ..\..\packages\System.Runtime.Extensions\ref\netstandard1.3\System.Runtime.Extensions.dll + False + True + + + + + + + ..\..\packages\System.Runtime.Extensions\ref\netstandard1.5\System.Runtime.Extensions.dll + False + True + + + + + + + + + ..\..\packages\System.Runtime.Handles\ref\netstandard1.3\System.Runtime.Handles.dll + False + True + + + + + + + + + ..\..\packages\System.Runtime.InteropServices\ref\netcoreapp1.1\System.Runtime.InteropServices.dll + False + True + + + + + + + ..\..\packages\System.Runtime.InteropServices\ref\netstandard1.1\System.Runtime.InteropServices.dll + False + True + + + + + + + ..\..\packages\System.Runtime.InteropServices\ref\netstandard1.2\System.Runtime.InteropServices.dll + False + True + + + + + + + ..\..\packages\System.Runtime.InteropServices\ref\netstandard1.3\System.Runtime.InteropServices.dll + False + True + + + + + + + ..\..\packages\System.Runtime.InteropServices\ref\netstandard1.5\System.Runtime.InteropServices.dll + False + True + + + + + + + + + ..\..\packages\System.Runtime.InteropServices.RuntimeInformation\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll + True + True + + + + + + + ..\..\packages\System.Runtime.InteropServices.RuntimeInformation\lib\netstandard1.1\System.Runtime.InteropServices.RuntimeInformation.dll + True + True + + + + + + + ..\..\packages\System.Runtime.InteropServices.RuntimeInformation\ref\netstandard1.1\System.Runtime.InteropServices.RuntimeInformation.dll + False + True + + + + + + + ..\..\packages\System.Runtime.InteropServices.RuntimeInformation\lib\wpa81\System.Runtime.InteropServices.RuntimeInformation.dll + True + True + + + + + + + + + ..\..\packages\System.Runtime.Numerics\ref\netstandard1.1\System.Runtime.Numerics.dll + False + True + + + + + + + ..\..\packages\System.Runtime.Numerics\lib\netstandard1.3\System.Runtime.Numerics.dll + True + True + + + + + + + + + ..\..\packages\System.Security.Cryptography.Algorithms\ref\netstandard1.3\System.Security.Cryptography.Algorithms.dll + False + True + + + + + + + ..\..\packages\System.Security.Cryptography.Algorithms\ref\netstandard1.4\System.Security.Cryptography.Algorithms.dll + False + True + + + + + + + ..\..\packages\System.Security.Cryptography.Algorithms\ref\netstandard1.6\System.Security.Cryptography.Algorithms.dll + False + True + + + + + + + + + ..\..\packages\System.Security.Cryptography.Cng\ref\netstandard1.6\System.Security.Cryptography.Cng.dll + False + True + + + + + + + + + ..\..\packages\System.Security.Cryptography.Csp\ref\netstandard1.3\System.Security.Cryptography.Csp.dll + False + True + + + + + + + + + ..\..\packages\System.Security.Cryptography.Encoding\ref\netstandard1.3\System.Security.Cryptography.Encoding.dll + False + True + + + + + + + + + ..\..\packages\System.Security.Cryptography.OpenSsl\lib\netstandard1.6\System.Security.Cryptography.OpenSsl.dll + True + True + + + + + + + ..\..\packages\System.Security.Cryptography.OpenSsl\ref\netstandard1.6\System.Security.Cryptography.OpenSsl.dll + False + True + + + + + + + + + ..\..\packages\System.Security.Cryptography.Primitives\lib\netstandard1.3\System.Security.Cryptography.Primitives.dll + True + True + + + + + + + ..\..\packages\System.Security.Cryptography.Primitives\ref\netstandard1.3\System.Security.Cryptography.Primitives.dll + False + True + + + + + + + + + ..\..\packages\System.Security.Cryptography.X509Certificates\ref\netstandard1.3\System.Security.Cryptography.X509Certificates.dll + False + True + + + + + + + ..\..\packages\System.Security.Cryptography.X509Certificates\ref\netstandard1.4\System.Security.Cryptography.X509Certificates.dll + False + True + + + + + + + + + ..\..\packages\System.Text.Encoding\ref\netstandard1.0\System.Text.Encoding.dll + False + True + + + + + + + ..\..\packages\System.Text.Encoding\ref\netstandard1.3\System.Text.Encoding.dll + False + True + + + + + + + + + ..\..\packages\System.Text.Encoding.Extensions\ref\netstandard1.0\System.Text.Encoding.Extensions.dll + False + True + + + + + + + ..\..\packages\System.Text.Encoding.Extensions\ref\netstandard1.3\System.Text.Encoding.Extensions.dll + False + True + + + + + + + + + ..\..\packages\System.Text.RegularExpressions\ref\netcoreapp1.1\System.Text.RegularExpressions.dll + False + True + + + + + + + ..\..\packages\System.Text.RegularExpressions\ref\netstandard1.0\System.Text.RegularExpressions.dll + False + True + + + + + + + ..\..\packages\System.Text.RegularExpressions\ref\netstandard1.3\System.Text.RegularExpressions.dll + False + True + + + + + + + ..\..\packages\System.Text.RegularExpressions\lib\netstandard1.6\System.Text.RegularExpressions.dll + True + True + + + + + + + ..\..\packages\System.Text.RegularExpressions\ref\netstandard1.6\System.Text.RegularExpressions.dll + False + True + + + + + + + + + ..\..\packages\System.Threading\ref\netstandard1.0\System.Threading.dll + False + True + + + + + + + ..\..\packages\System.Threading\lib\netstandard1.3\System.Threading.dll + True + True + + + + + + + ..\..\packages\System.Threading\ref\netstandard1.3\System.Threading.dll + False + True + + + + + + + + + ..\..\packages\System.Threading.Tasks\ref\netstandard1.0\System.Threading.Tasks.dll + False + True + + + + + + + ..\..\packages\System.Threading.Tasks\ref\netstandard1.3\System.Threading.Tasks.dll + False + True + + + + + + + + + ..\..\packages\System.Threading.Tasks.Extensions\lib\netstandard1.0\System.Threading.Tasks.Extensions.dll + True + True + + + + + + + + + ..\..\packages\System.Threading.Tasks.Parallel\ref\netstandard1.1\System.Threading.Tasks.Parallel.dll + False + True + + + + + + + ..\..\packages\System.Threading.Tasks.Parallel\lib\netstandard1.3\System.Threading.Tasks.Parallel.dll + True + True + + + + + + + + + ..\..\packages\System.Threading.Thread\lib\netstandard1.3\System.Threading.Thread.dll + True + True + + + + + + + ..\..\packages\System.Threading.Thread\ref\netstandard1.3\System.Threading.Thread.dll + False + True + + + + + + + + + ..\..\packages\System.Threading.ThreadPool\lib\netstandard1.3\System.Threading.ThreadPool.dll + True + True + + + + + + + ..\..\packages\System.Threading.ThreadPool\ref\netstandard1.3\System.Threading.ThreadPool.dll + False + True + + + + + + + + + ..\..\packages\System.Threading.Timer\ref\netstandard1.2\System.Threading.Timer.dll + False + True + + + + + + + + + True + + + + + + + ..\..\packages\System.Xml.ReaderWriter\ref\netstandard1.0\System.Xml.ReaderWriter.dll + False + True + + + + + + + ..\..\packages\System.Xml.ReaderWriter\lib\netstandard1.3\System.Xml.ReaderWriter.dll + True + True + + + + + + + ..\..\packages\System.Xml.ReaderWriter\ref\netstandard1.3\System.Xml.ReaderWriter.dll + False + True + + + + + + + + + True + + + + + + + ..\..\packages\System.Xml.XDocument\ref\netstandard1.0\System.Xml.XDocument.dll + False + True + + + + + + + ..\..\packages\System.Xml.XDocument\lib\netstandard1.3\System.Xml.XDocument.dll + True + True + + + + + + + ..\..\packages\System.Xml.XDocument\ref\netstandard1.3\System.Xml.XDocument.dll + False + True + + + + + + + + + ..\..\packages\xunit.abstractions\lib\net35\xunit.abstractions.dll + True + True + + + + + + + ..\..\packages\xunit.abstractions\lib\netstandard1.0\xunit.abstractions.dll + True + True + + + + + + + + + ..\..\packages\xunit.assert\lib\netstandard1.1\xunit.assert.dll + True + True + + + + + + + + + ..\..\packages\xunit.extensibility.core\lib\netstandard1.1\xunit.core.dll + True + True + + + + + + + + + ..\..\packages\xunit.extensibility.execution\lib\net452\xunit.execution.desktop.dll + True + True + + + + + + + ..\..\packages\xunit.extensibility.execution\lib\netstandard1.1\xunit.execution.dotnet.dll + True + True + + + + + diff --git a/tests/OpenTK.Tests.Integration/paket.references b/tests/OpenTK.Tests.Integration/paket.references new file mode 100644 index 00000000..ecbc089e --- /dev/null +++ b/tests/OpenTK.Tests.Integration/paket.references @@ -0,0 +1,2 @@ +FsCheck.Xunit +xunit.assert diff --git a/tests/OpenTK.Tests/App.config b/tests/OpenTK.Tests/App.config new file mode 100644 index 00000000..571e8b49 --- /dev/null +++ b/tests/OpenTK.Tests/App.config @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/OpenTK.Tests/AssemblyInfo.fs b/tests/OpenTK.Tests/AssemblyInfo.fs new file mode 100644 index 00000000..1d63b8ec --- /dev/null +++ b/tests/OpenTK.Tests/AssemblyInfo.fs @@ -0,0 +1,41 @@ +namespace OpenTK.Tests.AssemblyInfo + +open System.Reflection +open System.Runtime.CompilerServices +open System.Runtime.InteropServices + +// 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. +[] +[] +[] +[] +[] +[] +[] +[] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [] +[] +[] + +do + () \ No newline at end of file diff --git a/tests/OpenTK.Tests/Assertions.fs b/tests/OpenTK.Tests/Assertions.fs new file mode 100644 index 00000000..b3d8fe3f --- /dev/null +++ b/tests/OpenTK.Tests/Assertions.fs @@ -0,0 +1,79 @@ +namespace OpenTK.Tests + +open Xunit +open FsCheck +open FsCheck.Xunit +open System +open OpenTK + +[] +module private AssertHelpers = + [] + let private BitAccuracy = 16 + + [] + let private EquivalenceTolerance = 0.00005f + + let approxEq a b = MathHelper.ApproximatelyEquivalent(a, b, EquivalenceTolerance) + + let approxEqDelta a b = MathHelper.ApproximatelyEqual(a, b, BitAccuracy) + + let approxEqSingleEpsilon a b = MathHelper.ApproximatelyEqualEpsilon(a, b, 0.00001f) + let approxEqDoubleEpsilon a b = MathHelper.ApproximatelyEqualEpsilon(a, b, 0.00001) + + let approxEqSingleEpsilonWithError (a, b, c : float32) = MathHelper.ApproximatelyEqualEpsilon(a, b, c) + let approxEqDoubleEpsilonWithError (a, b, c : float) = MathHelper.ApproximatelyEqualEpsilon(a, b, c) + + let anyZero2 (a : Vector2) = (approxEq a.X 0.0f || approxEq a.Y 0.0f) + let anyZero3 (a : Vector3) = (approxEq a.X 0.0f || approxEq a.Y 0.0f || approxEq a.Z 0.0f) + let anyZero4 (a : Vector4) = (approxEq a.X 0.0f || approxEq a.Y 0.0f || approxEq a.Z 0.0f || approxEq a.W 0.0f) + +/// We use a full type here instead of a module, as the overloading semantics are more suitable for our desired goal. +[] +type internal Assert = + + static member ApproximatelyEquivalent(a : Vector2,b : Vector2) = + if not <| approxEq a.X b.X && approxEq a.Y b.Y then raise <| new Xunit.Sdk.EqualException(a,b) + + static member ApproximatelyEquivalent(a : Vector3,b : Vector3) = + if not <| approxEq a.X b.X && approxEq a.Y b.Y && approxEq a.Z b.Z then raise <| new Xunit.Sdk.EqualException(a,b) + + static member ApproximatelyEquivalent(a : Vector4,b : Vector4) = + if not <| approxEq a.X b.X && approxEq a.Y b.Y && approxEq a.Z b.Z && approxEq a.W b.W then + raise <| new Xunit.Sdk.EqualException(a,b) + + static member ApproximatelyEquivalent(a : float32,b : float32) = + if not <| approxEq a b then raise <| new Xunit.Sdk.EqualException(a,b) + + + static member ApproximatelyEqualEpsilon(a : float32, b : float32) = + if not <| approxEqSingleEpsilon a b then raise <| new Xunit.Sdk.EqualException(a,b) + + static member ApproximatelyEqualEpsilon(a : float32, b : float32, c : float32) = + if not <| approxEqSingleEpsilonWithError(a, b, c) then raise <| new Xunit.Sdk.EqualException(a,b) + + + static member ApproximatelyEqualEpsilon(a : float, b : float) = + if not <| approxEqDoubleEpsilon a b then raise <| new Xunit.Sdk.EqualException(a,b) + + static member ApproximatelyEqualEpsilon(a : float, b : float, c : float) = + if not <| approxEqDoubleEpsilonWithError(a, b, c) then raise <| new Xunit.Sdk.EqualException(a,b) + + + static member NotApproximatelyEqualEpsilon(a : float32, b : float32) = + if approxEqSingleEpsilon a b then raise <| new Xunit.Sdk.EqualException(a,b) + + static member NotApproximatelyEqualEpsilon(a : float32, b : float32, c : float32) = + if approxEqSingleEpsilonWithError(a, b, c) then raise <| new Xunit.Sdk.EqualException(a,b) + + + static member NotApproximatelyEqualEpsilon(a : float, b : float) = + if approxEqDoubleEpsilon a b then raise <| new Xunit.Sdk.EqualException(a,b) + + static member NotApproximatelyEqualEpsilon(a : float, b : float, c : float) = + if approxEqDoubleEpsilonWithError(a, b, c) then raise <| new Xunit.Sdk.EqualException(a,b) + + static member ThrowsIndexExn(f:unit -> unit) = Assert.Throws(f) |> ignore + + static member ApproximatelyEqual(a : float32, b : float32) = + if not <| approxEqDelta a b then raise <| new Xunit.Sdk.EqualException(a, b) diff --git a/tests/OpenTK.Tests/Generators.fs b/tests/OpenTK.Tests/Generators.fs new file mode 100644 index 00000000..39200f5b --- /dev/null +++ b/tests/OpenTK.Tests/Generators.fs @@ -0,0 +1,80 @@ +namespace OpenTK.Tests + +open Xunit +open FsCheck +open FsCheck.Xunit +open System +open OpenTK + +[] +module private Generators = + let private isValidFloat f = not (Single.IsNaN f || Single.IsInfinity f || Single.IsInfinity (f * f) || f = Single.MinValue || f = Single.MaxValue ) + let private isValidDouble d = not (Double.IsNaN d || Double.IsInfinity d || Double.IsInfinity (d * d)|| d = Double.MinValue || d = Double.MaxValue) + let singleArb = Arb.Default.Float32() |> Arb.toGen |> Gen.filter isValidFloat + let single = singleArb |> Arb.fromGen + + let double = + Arb.Default.Float() |> Arb.toGen + |> Gen.filter isValidDouble + |> Arb.fromGen + + let vec2 = + singleArb + |> Gen.two + |> Gen.map Vector2 + |> Gen.filter (fun v -> not <| (Single.IsNaN v.Length || Single.IsInfinity v.Length )) + |> Arb.fromGen + + let vec3 = + singleArb + |> Gen.three + |> Gen.map Vector3 + |> Gen.filter (fun v -> not <| (Single.IsNaN v.Length || Single.IsInfinity v.Length )) + |> Arb.fromGen + + let vec4 = + singleArb + |> Gen.four + |> Gen.map Vector4 + |> Gen.filter (fun v -> not <| (Single.IsNaN v.Length || Single.IsInfinity v.Length )) + |> Arb.fromGen + + let quat = + singleArb + |> Gen.three + |> Gen.map (fun (x,y,z) -> Quaternion(x,y,z,0.0f) |> Quaternion.Normalize) + |> Gen.filter (fun q -> not <| (Single.IsNaN q.Length || Single.IsInfinity q.Length )) + |> Arb.fromGen + + let mat2 = + singleArb + |> Gen.four + |> Gen.map Matrix2 + |> Arb.fromGen + + let mat3 = + vec3 + |> Arb.toGen + |> Gen.three + |> Gen.map Matrix3 + |> Arb.fromGen + + let mat4 = + vec4 + |> Arb.toGen + |> Gen.four + |> Gen.map Matrix4 + |> Arb.fromGen + +type OpenTKGen = + static member Single() = single + static member float32() = single + static member Double() = double + static member float() = double + static member Vector2() = vec2 + static member Vector3() = vec3 + static member Vector4() = vec4 + static member Quaternion() = quat + static member Matrix2() = mat2 + static member Matrix3() = mat3 + static member Matrix4() = mat4 diff --git a/tests/OpenTK.Tests/HalfTests.fs b/tests/OpenTK.Tests/HalfTests.fs new file mode 100644 index 00000000..ac2ec4e6 --- /dev/null +++ b/tests/OpenTK.Tests/HalfTests.fs @@ -0,0 +1,40 @@ +namespace OpenTK.Tests + +open Xunit +open FsCheck +open FsCheck.Xunit +open System +open System.Runtime.InteropServices +open OpenTK + +module Half = + [] + let ``Casting Half to Single and back to Half is lossless`` () = + for bits = int System.Int16.MinValue to int System.Int16.MaxValue do + let bytes = System.BitConverter.GetBytes(int16 bits) + let half = Half.FromBytes(bytes, 0) + let single = float32 half + let roundtrip = Half single + + Assert.True((half.IsNaN && roundtrip.IsNaN) || half = roundtrip) + + [] + let ``Half.ToString and Single.ToString return same string for same value`` () = + for bits = int System.Int16.MinValue to int System.Int16.MaxValue do + let bytes = System.BitConverter.GetBytes(int16 bits) + let half = Half.FromBytes(bytes, 0) + let single = float32 half + Assert.Equal(half.ToString(), single.ToString()) + + [] + let ``Half can represent all integers from -2048 to 2048 exactly`` () = + for i = -2048 to 2048 do + let single = float32 i + let half = Half single + Assert.Equal(single, float32 half) + + [] + let ``Single NaN and inifnity can be cast to Half NaN and infinity`` () = + Assert.True((Half System.Single.NaN).IsNaN) + Assert.True((Half System.Single.PositiveInfinity).IsPositiveInfinity) + Assert.True((Half System.Single.NegativeInfinity).IsNegativeInfinity) diff --git a/tests/OpenTK.Tests/MathHelperTests.fs b/tests/OpenTK.Tests/MathHelperTests.fs new file mode 100644 index 00000000..76b96e15 --- /dev/null +++ b/tests/OpenTK.Tests/MathHelperTests.fs @@ -0,0 +1,352 @@ +namespace OpenTK.Tests + +open Xunit +open FsCheck +open FsCheck.Xunit +open System +open OpenTK + +module MathHelper = + [ |])>] + module ``ApproximatelyEqual (delta)`` = + /// This test ensures that approximately equal can never get it 'wrong' about the values. + [] + let ``ApproximatelyEqual is never incorrect`` (a : float32,b : float32,bits : int32) = + let clamped = max 0 (min bits 24) + let areApproxEqual = MathHelper.ApproximatelyEqual(a,b,clamped) + let areExactlyEqual = a = b + let isWrong = areExactlyEqual && not areApproxEqual + Assert.False(isWrong) + + [] + let ``ApproximatelyEqual can return true if some values are not exactly equal`` (a : float32,b : float32,bits : int32) = + let clamped = max 0 (min bits 24) + let areApproxEqual = MathHelper.ApproximatelyEqual(a,b,clamped) + let areExactlyEqual = a = b + let isWrong = areExactlyEqual && not areApproxEqual + let p = new PropertyAttribute() + Assert.False(isWrong) + + [] + let ``ApproximatelyEqual correctly approximates equality``() = + let a = 0.000000001f + let b = 0.0000000010000001f + Assert.NotEqual(a,b) + [ 1..24 ] |> List.iter (fun i -> Assert.True(MathHelper.ApproximatelyEqual(a,b,i))) + + [] + let ``ApproximatelyEqual reports very different values as non-equal even with high bit count``() = + let a = 2.0f + let b = 1.0f + Assert.NotEqual(a,b) + Assert.False(MathHelper.ApproximatelyEqual(a,b,10)) + + [] + let ``ApproximatelyEqual works with single zero value``() = + let a = 1.0f + let b = 0.0f + Assert.NotEqual(a,b) + Assert.False(MathHelper.ApproximatelyEqual(a,b,0)) + + [] + let ``ApproximatelyEqual works with both zero values``() = + let a = 0.0f + let b = 0.0f + Assert.Equal(a,b) + Assert.True(MathHelper.ApproximatelyEqual(a,b,0)) + + [ |])>] + module ``ApproximatelyEqual (single-precision epsilon)`` = + // + [] + let ``ApproximatelyEqual (single precision) is correct for large positive values``() = + Assert.ApproximatelyEqualEpsilon(1000000.0f, 1000001.0f); + Assert.ApproximatelyEqualEpsilon(1000001.0f, 1000000.0f); + Assert.NotApproximatelyEqualEpsilon(10000.0f, 10001.0f); + Assert.NotApproximatelyEqualEpsilon(10001.0f, 10000.0f); + + [] + let ``ApproximatelyEqual (single precision) is correct for large negative values``() = + Assert.ApproximatelyEqualEpsilon(-1000000.0f, -1000001.0f); + Assert.ApproximatelyEqualEpsilon(-1000001.0f, -1000000.0f); + Assert.NotApproximatelyEqualEpsilon(-10000.0f, -10001.0f); + Assert.NotApproximatelyEqualEpsilon(-10001.0f, -10000.0f); + + [] + let ``ApproximatelyEqual (single precision) is correct for positive values around 1``() = + Assert.ApproximatelyEqualEpsilon(1.0000001f, 1.0000002f); + Assert.ApproximatelyEqualEpsilon(1.0000002f, 1.0000001f); + Assert.NotApproximatelyEqualEpsilon(1.0002f, 1.0001f); + Assert.NotApproximatelyEqualEpsilon(1.0001f, 1.0002f); + + [] + let ``ApproximatelyEqual (single precision) is correct for negative values around -1``() = + Assert.ApproximatelyEqualEpsilon(-1.000001f, -1.000002f); + Assert.ApproximatelyEqualEpsilon(-1.000002f, -1.000001f); + Assert.NotApproximatelyEqualEpsilon(-1.0001f, -1.0002f); + Assert.NotApproximatelyEqualEpsilon(-1.0002f, -1.0001f); + + [] + let ``ApproximatelyEqual (single precision) is correct for values between 1 and 0``() = + Assert.ApproximatelyEqualEpsilon(0.000000001000001f, 0.000000001000002f); + Assert.ApproximatelyEqualEpsilon(0.000000001000002f, 0.000000001000001f); + Assert.NotApproximatelyEqualEpsilon(0.000000000001002f, 0.000000000001001f); + Assert.NotApproximatelyEqualEpsilon(0.000000000001001f, 0.000000000001002f); + + [] + let ``ApproximatelyEqual (single precision) is correct for values between -1 and 0``() = + Assert.ApproximatelyEqualEpsilon(-0.000000001000001f, -0.000000001000002f); + Assert.ApproximatelyEqualEpsilon(-0.000000001000002f, -0.000000001000001f); + Assert.NotApproximatelyEqualEpsilon(-0.000000000001002f, -0.000000000001001f); + Assert.NotApproximatelyEqualEpsilon(-0.000000000001001f, -0.000000000001002f); + + [] + let ``ApproximatelyEqual (single precision) is correct for comparisons involving 0``() = + Assert.ApproximatelyEqualEpsilon(0.0f, 0.0f); + Assert.ApproximatelyEqualEpsilon(0.0f, -0.0f); + Assert.ApproximatelyEqualEpsilon(-0.0f, -0.0f); + Assert.NotApproximatelyEqualEpsilon(0.00000001f, 0.0f); + Assert.NotApproximatelyEqualEpsilon(0.0f, 0.00000001f); + Assert.NotApproximatelyEqualEpsilon(-0.00000001f, 0.0f); + Assert.NotApproximatelyEqualEpsilon(0.0f, -0.00000001f); + + Assert.ApproximatelyEqualEpsilon(0.0f, 1e-40f, 0.01f); + Assert.ApproximatelyEqualEpsilon(1e-40f, 0.0f, 0.01f); + Assert.NotApproximatelyEqualEpsilon(1e-40f, 0.0f, 0.000001f); + Assert.NotApproximatelyEqualEpsilon(0.0f, 1e-40f, 0.000001f); + + Assert.ApproximatelyEqualEpsilon(0.0f, -1e-40f, 0.1f); + Assert.ApproximatelyEqualEpsilon(-1e-40f, 0.0f, 0.1f); + Assert.NotApproximatelyEqualEpsilon(-1e-40f, 0.0f, 0.00000001f); + Assert.NotApproximatelyEqualEpsilon(0.0f, -1e-40f, 0.00000001f); + + [] + let ``ApproximatelyEqual (single precision) is correct for extreme values with overflow potential``() = + Assert.ApproximatelyEqualEpsilon(System.Single.MaxValue, System.Single.MaxValue); + Assert.NotApproximatelyEqualEpsilon(System.Single.MaxValue, -System.Single.MaxValue); + Assert.NotApproximatelyEqualEpsilon(-System.Single.MaxValue, System.Single.MaxValue); + Assert.NotApproximatelyEqualEpsilon(System.Single.MaxValue, System.Single.MaxValue / 2.0f); + Assert.NotApproximatelyEqualEpsilon(System.Single.MaxValue, -System.Single.MaxValue / 2.0f); + Assert.NotApproximatelyEqualEpsilon(-System.Single.MaxValue, System.Single.MaxValue / 2.0f); + + [] + let ``ApproximatelyEqual (single precision) is correct for values involving infinities``() = + Assert.ApproximatelyEqualEpsilon(System.Single.PositiveInfinity, System.Single.PositiveInfinity); + Assert.ApproximatelyEqualEpsilon(System.Single.NegativeInfinity, System.Single.NegativeInfinity); + Assert.NotApproximatelyEqualEpsilon(System.Single.NegativeInfinity, System.Single.PositiveInfinity); + Assert.NotApproximatelyEqualEpsilon(System.Single.PositiveInfinity, System.Single.MaxValue); + Assert.NotApproximatelyEqualEpsilon(System.Single.NegativeInfinity, -System.Single.MaxValue); + + [] + let ``ApproximatelyEqual (single precision) is correct for values involving NaN``() = + Assert.NotApproximatelyEqualEpsilon(System.Single.NaN, System.Single.NaN); + Assert.NotApproximatelyEqualEpsilon(System.Single.NaN, 0.0f); + Assert.NotApproximatelyEqualEpsilon(-0.0f, System.Single.NaN); + Assert.NotApproximatelyEqualEpsilon(System.Single.NaN, -0.0f); + Assert.NotApproximatelyEqualEpsilon(0.0f, System.Single.NaN); + Assert.NotApproximatelyEqualEpsilon(System.Single.NaN, System.Single.PositiveInfinity); + Assert.NotApproximatelyEqualEpsilon(System.Single.PositiveInfinity, System.Single.NaN); + Assert.NotApproximatelyEqualEpsilon(System.Single.NaN, System.Single.NegativeInfinity); + Assert.NotApproximatelyEqualEpsilon(System.Single.NegativeInfinity, System.Single.NaN); + Assert.NotApproximatelyEqualEpsilon(System.Single.NaN, System.Single.MaxValue); + Assert.NotApproximatelyEqualEpsilon(System.Single.MaxValue, System.Single.NaN); + Assert.NotApproximatelyEqualEpsilon(System.Single.NaN, -System.Single.MaxValue); + Assert.NotApproximatelyEqualEpsilon(-System.Single.MaxValue, System.Single.NaN); + Assert.NotApproximatelyEqualEpsilon(System.Single.NaN, System.Single.Epsilon); + Assert.NotApproximatelyEqualEpsilon(System.Single.Epsilon, System.Single.NaN); + Assert.NotApproximatelyEqualEpsilon(System.Single.NaN, -System.Single.Epsilon); + Assert.NotApproximatelyEqualEpsilon(-System.Single.Epsilon, System.Single.NaN); + + [] + let ``ApproximatelyEqual (single precision) is correct for values on opposite sides of 0``() = + Assert.NotApproximatelyEqualEpsilon(1.000000001f, -1.0f); + Assert.NotApproximatelyEqualEpsilon(-1.0f, 1.000000001f); + Assert.NotApproximatelyEqualEpsilon(-1.000000001f, 1.0f); + Assert.NotApproximatelyEqualEpsilon(1.0f, -1.000000001f); + Assert.ApproximatelyEqualEpsilon(10.0f * System.Single.Epsilon, 10.0f * -System.Single.Epsilon); + Assert.NotApproximatelyEqualEpsilon(10000.0f * System.Single.Epsilon, 10000.0f * -System.Single.Epsilon); + + [] + let ``ApproximatelyEqual (single precision) is correct for values very close to 0``() = + Assert.ApproximatelyEqualEpsilon(System.Single.Epsilon, System.Single.Epsilon); + Assert.ApproximatelyEqualEpsilon(System.Single.Epsilon, -System.Single.Epsilon); + Assert.ApproximatelyEqualEpsilon(-System.Single.Epsilon, System.Single.Epsilon); + Assert.ApproximatelyEqualEpsilon(System.Single.Epsilon, 0.0f); + Assert.ApproximatelyEqualEpsilon(0.0f, System.Single.Epsilon); + Assert.ApproximatelyEqualEpsilon(-System.Single.Epsilon, 0.0f); + Assert.ApproximatelyEqualEpsilon(0.0f, -System.Single.Epsilon); + + Assert.NotApproximatelyEqualEpsilon(0.000000001f, -System.Single.Epsilon); + Assert.NotApproximatelyEqualEpsilon(0.000000001f, System.Single.Epsilon); + Assert.NotApproximatelyEqualEpsilon(System.Single.Epsilon, 0.000000001f); + Assert.NotApproximatelyEqualEpsilon(-System.Single.Epsilon, 0.000000001f); + + [ |])>] + module ``ApproximatelyEqual (double-precision epsilon)`` = + // + [] + let ``ApproximatelyEqual (double precision) is correct for large positive values``() = + Assert.ApproximatelyEqualEpsilon(1000000.0, 1000001.0); + Assert.ApproximatelyEqualEpsilon(1000001.0, 1000000.0); + Assert.NotApproximatelyEqualEpsilon(10000.0, 10001.0); + Assert.NotApproximatelyEqualEpsilon(10001.0, 10000.0); + + [] + let ``ApproximatelyEqual (double precision) is correct for large negative values``() = + Assert.ApproximatelyEqualEpsilon(-1000000.0, -1000001.0); + Assert.ApproximatelyEqualEpsilon(-1000001.0, -1000000.0); + Assert.NotApproximatelyEqualEpsilon(-10000.0, -10001.0); + Assert.NotApproximatelyEqualEpsilon(-10001.0, -10000.0); + + [] + let ``ApproximatelyEqual (double precision) is correct for positive values around 1``() = + Assert.ApproximatelyEqualEpsilon(1.0000001, 1.0000002); + Assert.ApproximatelyEqualEpsilon(1.0000002, 1.0000001); + Assert.NotApproximatelyEqualEpsilon(1.0002, 1.0001); + Assert.NotApproximatelyEqualEpsilon(1.0001, 1.0002); + + [] + let ``ApproximatelyEqual (double precision) is correct for negative values around -1``() = + Assert.ApproximatelyEqualEpsilon(-1.000001, -1.000002); + Assert.ApproximatelyEqualEpsilon(-1.000002, -1.000001); + Assert.NotApproximatelyEqualEpsilon(-1.0001, -1.0002); + Assert.NotApproximatelyEqualEpsilon(-1.0002, -1.0001); + + [] + let ``ApproximatelyEqual (double precision) is correct for values between 1 and 0``() = + Assert.ApproximatelyEqualEpsilon(0.000000001000001, 0.000000001000002); + Assert.ApproximatelyEqualEpsilon(0.000000001000002, 0.000000001000001); + Assert.NotApproximatelyEqualEpsilon(0.000000000001002, 0.000000000001001); + Assert.NotApproximatelyEqualEpsilon(0.000000000001001, 0.000000000001002); + + [] + let ``ApproximatelyEqual (double precision) is correct for values between -1 and 0``() = + Assert.ApproximatelyEqualEpsilon(-0.000000001000001, -0.000000001000002); + Assert.ApproximatelyEqualEpsilon(-0.000000001000002, -0.000000001000001); + Assert.NotApproximatelyEqualEpsilon(-0.000000000001002, -0.000000000001001); + Assert.NotApproximatelyEqualEpsilon(-0.000000000001001, -0.000000000001002); + + [] + let ``ApproximatelyEqual (double precision) is correct for comparisons involving 0``() = + Assert.ApproximatelyEqualEpsilon(0.0, 0.0); + Assert.ApproximatelyEqualEpsilon(0.0, -0.0); + Assert.ApproximatelyEqualEpsilon(-0.0, -0.0); + Assert.NotApproximatelyEqualEpsilon(0.00000001, 0.0); + Assert.NotApproximatelyEqualEpsilon(0.0, 0.00000001); + Assert.NotApproximatelyEqualEpsilon(-0.00000001, 0.0); + Assert.NotApproximatelyEqualEpsilon(0.0, -0.00000001); + + Assert.ApproximatelyEqualEpsilon(0.0, 1e-310, 0.01); + Assert.ApproximatelyEqualEpsilon(1e-310, 0.0, 0.01); + Assert.NotApproximatelyEqualEpsilon(1e-310, 0.0, 0.000001); + Assert.NotApproximatelyEqualEpsilon(0.0, 1e-310, 0.000001); + + Assert.ApproximatelyEqualEpsilon(0.0, -1e-310, 0.1); + Assert.ApproximatelyEqualEpsilon(-1e-310, 0.0, 0.1); + Assert.NotApproximatelyEqualEpsilon(-1e-310, 0.0, 0.00000001); + Assert.NotApproximatelyEqualEpsilon(0.0, -1e-310, 0.00000001); + + [] + let ``ApproximatelyEqual (double precision) is correct for extreme values with overflow potential``() = + Assert.ApproximatelyEqualEpsilon(System.Double.MaxValue, System.Double.MaxValue); + Assert.NotApproximatelyEqualEpsilon(System.Double.MaxValue, -System.Double.MaxValue); + Assert.NotApproximatelyEqualEpsilon(-System.Double.MaxValue, System.Double.MaxValue); + Assert.NotApproximatelyEqualEpsilon(System.Double.MaxValue, System.Double.MaxValue / 2.0); + Assert.NotApproximatelyEqualEpsilon(System.Double.MaxValue, -System.Double.MaxValue / 2.0); + Assert.NotApproximatelyEqualEpsilon(-System.Double.MaxValue, System.Double.MaxValue / 2.0); + + [] + let ``ApproximatelyEqual (double precision) is correct for values involving infinities``() = + Assert.ApproximatelyEqualEpsilon(System.Double.PositiveInfinity, System.Double.PositiveInfinity); + Assert.ApproximatelyEqualEpsilon(System.Double.NegativeInfinity, System.Double.NegativeInfinity); + Assert.NotApproximatelyEqualEpsilon(System.Double.NegativeInfinity, System.Double.PositiveInfinity); + Assert.NotApproximatelyEqualEpsilon(System.Double.PositiveInfinity, System.Double.MaxValue); + Assert.NotApproximatelyEqualEpsilon(System.Double.NegativeInfinity, -System.Double.MaxValue); + + [] + let ``ApproximatelyEqual (double precision) is correct for values involving NaN``() = + Assert.NotApproximatelyEqualEpsilon(System.Double.NaN, System.Double.NaN); + Assert.NotApproximatelyEqualEpsilon(System.Double.NaN, 0.0); + Assert.NotApproximatelyEqualEpsilon(-0.0, System.Double.NaN); + Assert.NotApproximatelyEqualEpsilon(System.Double.NaN, -0.0); + Assert.NotApproximatelyEqualEpsilon(0.0, System.Double.NaN); + Assert.NotApproximatelyEqualEpsilon(System.Double.NaN, System.Double.PositiveInfinity); + Assert.NotApproximatelyEqualEpsilon(System.Double.PositiveInfinity, System.Double.NaN); + Assert.NotApproximatelyEqualEpsilon(System.Double.NaN, System.Double.NegativeInfinity); + Assert.NotApproximatelyEqualEpsilon(System.Double.NegativeInfinity, System.Double.NaN); + Assert.NotApproximatelyEqualEpsilon(System.Double.NaN, System.Double.MaxValue); + Assert.NotApproximatelyEqualEpsilon(System.Double.MaxValue, System.Double.NaN); + Assert.NotApproximatelyEqualEpsilon(System.Double.NaN, -System.Double.MaxValue); + Assert.NotApproximatelyEqualEpsilon(-System.Double.MaxValue, System.Double.NaN); + Assert.NotApproximatelyEqualEpsilon(System.Double.NaN, System.Double.Epsilon); + Assert.NotApproximatelyEqualEpsilon(System.Double.Epsilon, System.Double.NaN); + Assert.NotApproximatelyEqualEpsilon(System.Double.NaN, -System.Double.Epsilon); + Assert.NotApproximatelyEqualEpsilon(-System.Double.Epsilon, System.Double.NaN); + + [] + let ``ApproximatelyEqual (double precision) is correct for values on opposite sides of 0``() = + Assert.NotApproximatelyEqualEpsilon(1.000000001, -1.0); + Assert.NotApproximatelyEqualEpsilon(-1.0, 1.000000001); + Assert.NotApproximatelyEqualEpsilon(-1.000000001, 1.0); + Assert.NotApproximatelyEqualEpsilon(1.0, -1.000000001); + Assert.ApproximatelyEqualEpsilon(10.0 * System.Double.Epsilon, 10.0 * -System.Double.Epsilon); + Assert.NotApproximatelyEqualEpsilon(100000000000.0 * System.Double.Epsilon, 100000000000.0 * -System.Double.Epsilon); + + [] + let ``ApproximatelyEqual (double precision) is correct for values very close to 0``() = + Assert.ApproximatelyEqualEpsilon(System.Double.Epsilon, System.Double.Epsilon); + Assert.ApproximatelyEqualEpsilon(System.Double.Epsilon, -System.Double.Epsilon); + Assert.ApproximatelyEqualEpsilon(-System.Double.Epsilon, System.Double.Epsilon); + Assert.ApproximatelyEqualEpsilon(System.Double.Epsilon, 0.0); + Assert.ApproximatelyEqualEpsilon(0.0, System.Double.Epsilon); + Assert.ApproximatelyEqualEpsilon(-System.Double.Epsilon, 0.0); + Assert.ApproximatelyEqualEpsilon(0.0, -System.Double.Epsilon); + + Assert.NotApproximatelyEqualEpsilon(0.000000001, -System.Double.Epsilon); + Assert.NotApproximatelyEqualEpsilon(0.000000001, System.Double.Epsilon); + Assert.NotApproximatelyEqualEpsilon(System.Double.Epsilon, 0.000000001); + Assert.NotApproximatelyEqualEpsilon(-System.Double.Epsilon, 0.000000001); + + [ |])>] + module ``ApproximatelyEquivalent (tolerance diff)`` = + [] + let ``ApproximatelyEquivalent correctly approximates equivalence where the difference falls below the tolerance``() = + let a = 0.0001f + let b = 0.00019f + Assert.NotEqual(a,b) + Assert.True(MathHelper.ApproximatelyEquivalent(a, b, 0.0001f)) + + [] + let ``ApproximatelyEquivalent correctly approximates equivalence where the difference is the tolerance``() = + let a = 0.0001f + let b = 0.0002f + Assert.NotEqual(a,b) + Assert.True(MathHelper.ApproximatelyEquivalent(a, b, 0.0001f)) + + [] + let ``ApproximatelyEquivalent correctly approximates inequivalence where the difference exceeds the tolerance``() = + let a = 0.0001f + let b = 0.00021f + Assert.NotEqual(a,b) + Assert.False(MathHelper.ApproximatelyEquivalent(a, b, 0.0001f)) + + [] + let ``ApproximatelyEquivalent reports very different values as non-equal even with a high tolerance``() = + let a = 3.0f + let b = 1.0f + Assert.NotEqual(a,b) + Assert.False(MathHelper.ApproximatelyEquivalent(a, b, 1.0f)) + + [] + let ``ApproximatelyEquivalent works with single zero value``() = + let a = 1.0f + let b = 0.0f + Assert.NotEqual(a,b) + Assert.False(MathHelper.ApproximatelyEquivalent(a, b, 0.0001f)) + + [] + let ``ApproximatelyEquivalent works with both zero values``() = + let a = 0.0f + let b = 0.0f + Assert.Equal(a,b) + Assert.True(MathHelper.ApproximatelyEquivalent(a, b, 0.0001f)) \ No newline at end of file diff --git a/tests/OpenTK.Tests/Matrix4Test.cs b/tests/OpenTK.Tests/Matrix4Test.cs deleted file mode 100644 index 97cc8862..00000000 --- a/tests/OpenTK.Tests/Matrix4Test.cs +++ /dev/null @@ -1,289 +0,0 @@ -using System; -using NUnit.Framework; -using OpenTK; - -namespace OpenTK.Tests -{ - [TestFixture] - public class Matrix4Test - { - [Test] - public void Matrix4_SixteenValueConstructor() - { - Matrix4 A = new Matrix4( 0, 1, 2, 3, - 4, 5, 6, 7, - 8, 9, 10, 11, - 12, 13, 14, 15); - - Assert.AreEqual(0, A.M11); - Assert.AreEqual(1, A.M12); - Assert.AreEqual(2, A.M13); - Assert.AreEqual(3, A.M14); - - Assert.AreEqual(4, A.M21); - Assert.AreEqual(5, A.M22); - Assert.AreEqual(6, A.M23); - Assert.AreEqual(7, A.M24); - - Assert.AreEqual(8, A.M31); - Assert.AreEqual(9, A.M32); - Assert.AreEqual(10, A.M33); - Assert.AreEqual(11, A.M34); - - Assert.AreEqual(12, A.M41); - Assert.AreEqual(13, A.M42); - Assert.AreEqual(14, A.M43); - Assert.AreEqual(15, A.M44); - } - - [Test] - public void Matrix4_Matrix3Constructor() - { - Matrix3 B = new Matrix3( 1, 2, 3, - 4, 5, 6, - 7, 8, 9); - - Matrix4 A = new Matrix4(B); - - Assert.AreEqual(B.M11, A.M11); - Assert.AreEqual(B.M12, A.M12); - Assert.AreEqual(B.M13, A.M13); - - Assert.AreEqual(B.M21, A.M21); - Assert.AreEqual(B.M22, A.M22); - Assert.AreEqual(B.M23, A.M23); - - Assert.AreEqual(B.M31, A.M31); - Assert.AreEqual(B.M32, A.M32); - Assert.AreEqual(B.M33, A.M33); - } - - [Test] - public void Matrix4_FourVector4Constructor() - { - Vector4 V = new Vector4(1, 2, 3, 4); - Vector4 U = new Vector4(5, 6, 7, 8); - Vector4 S = new Vector4(9, 10, 11, 12); - Vector4 T = new Vector4(13, 14, 15, 16); - - Matrix4 A = new Matrix4(V, U, S, T); - - Assert.AreEqual(V.X, A.M11); - Assert.AreEqual(V.Y, A.M12); - Assert.AreEqual(V.Z, A.M13); - Assert.AreEqual(V.W, A.M14); - - Assert.AreEqual(U.X, A.M21); - Assert.AreEqual(U.Y, A.M22); - Assert.AreEqual(U.Z, A.M23); - Assert.AreEqual(U.W, A.M24); - - Assert.AreEqual(S.X, A.M31); - Assert.AreEqual(S.Y, A.M32); - Assert.AreEqual(S.Z, A.M33); - Assert.AreEqual(S.W, A.M34); - - Assert.AreEqual(T.X, A.M41); - Assert.AreEqual(T.Y, A.M42); - Assert.AreEqual(T.Z, A.M43); - Assert.AreEqual(T.W, A.M44); - - } - - [Test] - public void Matrix4_Equal_operator() - { - Matrix4 A = new Matrix4( 0, 1, 2, 3, - 4, 5, 6, 7, - 8, 9, 10, 11, - 12, 13, 14, 15); - - Matrix4 B = new Matrix4( 0, 1, 2, 3, - 4, 5, 6, 7, - 8, 9, 10, 11, - 12, 13, 14, 15); - - Assert.IsTrue(A == B); - } - - [Test] - public void Matrix4_Matrix4TimesMatrix4_operator() - { - Matrix4 A = new Matrix4( 0, 1, 2, 3, - 4, 5, 6, 7, - 8, 9, 10, 11, - 12, 13, 14, 15); - - Matrix4 B = new Matrix4( 0, 1, 2, 3, - 4, 5, 6, 7, - 8, 9, 10, 11, - 12, 13, 14, 15); - - Matrix4 expected = new Matrix4( 56, 62, 68, 74, - 152, 174, 196, 218, - 248, 286, 324, 362, - 344, 398, 452, 506); - - Matrix4 result = A * B; - Assert.IsTrue(expected == result); - } - - [Test] - public void Matrix4_Matrix4PlusMatrix4_operator() - { - Matrix4 A = new Matrix4( 0, 1, 2, 3, - 4, 5, 6, 7, - 8, 9, 10, 11, - 12, 13, 14, 15); - - Matrix4 B = new Matrix4( 0, 1, 2, 3, - 4, 5, 6, 7, - 8, 9, 10, 11, - 12, 13, 14, 15); - - Matrix4 expected = new Matrix4( 0, 2, 4, 6, - 8, 10, 12, 14, - 16, 18, 20, 22, - 24, 26, 28, 30); - - Matrix4 result = A + B; - Assert.IsTrue(expected == result); - } - - [Test] - public void Matrix4_Matrix4MinusMatrix4_operator() - { - Matrix4 A = new Matrix4( 0, 1, 2, 3, - 4, 5, 6, 7, - 8, 9, 10, 11, - 12, 13, 14, 15); - - Matrix4 B = new Matrix4( 0, 1, 2, 3, - 4, 5, 6, 7, - 8, 9, 10, 11, - 12, 13, 14, 15); - - Matrix4 expected = new Matrix4( 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0); - - Matrix4 result = A - B; - Assert.IsTrue(expected == result); - } - - [Test] - public void Matrix4_Index_Operator() - { - Matrix4 A = new Matrix4(); - A[0, 0] = 0; - A[0, 1] = 1; - A[0, 2] = 2; - A[0, 3] = 3; - A[1, 0] = 4; - A[1, 1] = 5; - A[1, 2] = 6; - A[1, 3] = 7; - A[2, 0] = 8; - A[2, 1] = 9; - A[2, 2] = 10; - A[2, 3] = 11; - A[3, 0] = 12; - A[3, 1] = 13; - A[3, 2] = 14; - A[3, 3] = 15; - Assert.AreEqual(0, A[0, 0]); - Assert.AreEqual(1, A[0, 1]); - Assert.AreEqual(2, A[0, 2]); - Assert.AreEqual(3, A[0, 3]); - Assert.AreEqual(4, A[1, 0]); - Assert.AreEqual(5, A[1, 1]); - Assert.AreEqual(6, A[1, 2]); - Assert.AreEqual(7, A[1, 3]); - Assert.AreEqual(8, A[2, 0]); - Assert.AreEqual(9, A[2, 1]); - Assert.AreEqual(10, A[2, 2]); - Assert.AreEqual(11, A[2, 3]); - Assert.AreEqual(12, A[3, 0]); - Assert.AreEqual(13, A[3, 1]); - Assert.AreEqual(14, A[3, 2]); - Assert.AreEqual(15, A[3, 3]); - } - - [Test] - public void Matrix4_Index_NegativeIndexException() - { - Matrix4 A = new Matrix4(); - bool negativeIndexException = false; - try - { - A[-1, 2] = 0; - } - catch(Exception) - { - negativeIndexException = true; - } - Assert.IsTrue(negativeIndexException); - - negativeIndexException = false; - try - { - A[1, -2] = 0; - } - catch (Exception) - { - negativeIndexException = true; - } - Assert.IsTrue(negativeIndexException); - - negativeIndexException = false; - try - { - A[-1, -2] = 0; - } - catch (Exception) - { - negativeIndexException = true; - } - Assert.IsTrue(negativeIndexException); - } - - [Test] - public void Matrix4_Index_LargeIndexException() - { - Matrix4 A = new Matrix4(); - bool largeIndexException = false; - try - { - A[5, 2] = 0; - } - catch (Exception) - { - largeIndexException = true; - } - Assert.IsTrue(largeIndexException); - - largeIndexException = false; - try - { - A[1, 6] = 0; - } - catch (Exception) - { - largeIndexException = true; - } - Assert.IsTrue(largeIndexException); - - largeIndexException = false; - try - { - A[7, 12] = 0; - } - catch (Exception) - { - largeIndexException = true; - } - Assert.IsTrue(largeIndexException); - } - } -} diff --git a/tests/OpenTK.Tests/Matrix4Tests.fs b/tests/OpenTK.Tests/Matrix4Tests.fs new file mode 100644 index 00000000..e4ca3f5d --- /dev/null +++ b/tests/OpenTK.Tests/Matrix4Tests.fs @@ -0,0 +1,396 @@ +namespace OpenTK.Tests + +open Xunit +open FsCheck +open FsCheck.Xunit +open System +open OpenTK + +module Matrix4 = + [ |])>] + module Constructors = + // + [] + let ``Sixteen value constructor sets all components to the correct values`` (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) = + let A = Matrix4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) + + Assert.Equal(a, A.M11) + Assert.Equal(b, A.M12) + Assert.Equal(c, A.M13) + Assert.Equal(d, A.M14) + + Assert.Equal(e, A.M21) + Assert.Equal(f, A.M22) + Assert.Equal(g, A.M23) + Assert.Equal(h, A.M24) + + Assert.Equal(i, A.M31) + Assert.Equal(j, A.M32) + Assert.Equal(k, A.M33) + Assert.Equal(l, A.M34) + + Assert.Equal(m, A.M41) + Assert.Equal(n, A.M42) + Assert.Equal(o, A.M43) + Assert.Equal(p, A.M44) + + [] + let ``Matrix3 partial constructor sets all components to the correct values`` (a, b, c, d, e, f, g, h, i) = + let B = Matrix3(a, b, c, d, e, f, g, h, i) + let A = Matrix4(B) + + Assert.Equal(a, A.M11) + Assert.Equal(b, A.M12) + Assert.Equal(c, A.M13) + Assert.Equal(0.0f, A.M14) + + Assert.Equal(d, A.M21) + Assert.Equal(e, A.M22) + Assert.Equal(f, A.M23) + Assert.Equal(0.0f, A.M24) + + Assert.Equal(g, A.M31) + Assert.Equal(h, A.M32) + Assert.Equal(i, A.M33) + Assert.Equal(0.0f, A.M34) + + Assert.Equal(0.0f, A.M41) + Assert.Equal(0.0f, A.M42) + Assert.Equal(0.0f, A.M43) + Assert.Equal(1.0f, A.M44) + + [] + let ``Four-vector4 constructor sets all components to the correct values`` (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) = + let v1 = Vector4(a, b, c, d) + let v2 = Vector4(e, f, g, h) + let v3 = Vector4(i, j, k, l) + let v4 = Vector4(m, n, o, p) + + let A = Matrix4(v1, v2, v3, v4) + + Assert.Equal(a, A.M11) + Assert.Equal(b, A.M12) + Assert.Equal(c, A.M13) + Assert.Equal(d, A.M14) + + Assert.Equal(e, A.M21) + Assert.Equal(f, A.M22) + Assert.Equal(g, A.M23) + Assert.Equal(h, A.M24) + + Assert.Equal(i, A.M31) + Assert.Equal(j, A.M32) + Assert.Equal(k, A.M33) + Assert.Equal(l, A.M34) + + Assert.Equal(m, A.M41) + Assert.Equal(n, A.M42) + Assert.Equal(o, A.M43) + Assert.Equal(p, A.M44) + + [ |])>] + module Equality = + // + [] + let ``Two matrices with identical values are equal`` (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) = + let A = Matrix4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) + let B = Matrix4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) + let equality = A = B + + Assert.True(equality) + + [] + let ``A matrix is not equal to an object which is not a matrix`` (a : Matrix4, b : Vector3) = + Assert.False(a.Equals(b)) + + [ |])>] + module Multiplication = + // + [] + let ``Matrix multiplication is done by row/column multiplication and summation`` (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) = + let A = Matrix4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) + let B = Matrix4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) + + let R11 = a*a + b*e + c*i + d*m + let R12 = a*b + b*f + c*j + d*n + let R13 = a*c + b*g + c*k + d*o + let R14 = a*d + b*h + c*l + d*p + + let R21 = e*a + f*e + g*i + h*m + let R22 = e*b + f*f + g*j + h*n + let R23 = e*c + f*g + g*k + h*o + let R24 = e*d + f*h + g*l + h*p + + let R31 = i*a + j*e + k*i + l*m + let R32 = i*b + j*f + k*j + l*n + let R33 = i*c + j*g + k*k + l*o + let R34 = i*d + j*h + k*l + l*p + + let R41 = m*a + n*e + o*i + p*m + let R42 = m*b + n*f + o*j + p*n + let R43 = m*c + n*g + o*k + p*o + let R44 = m*d + n*h + o*l + p*p + + let AB = A*B + + Assert.Equal(R11, AB.M11) + Assert.Equal(R12, AB.M12) + Assert.Equal(R13, AB.M13) + Assert.Equal(R14, AB.M14) + + Assert.Equal(R21, AB.M21) + Assert.Equal(R22, AB.M22) + Assert.Equal(R23, AB.M23) + Assert.Equal(R24, AB.M24) + + Assert.Equal(R31, AB.M31) + Assert.Equal(R32, AB.M32) + Assert.Equal(R33, AB.M33) + Assert.Equal(R34, AB.M34) + + Assert.Equal(R41, AB.M41) + Assert.Equal(R42, AB.M42) + Assert.Equal(R43, AB.M43) + Assert.Equal(R44, AB.M44) + + [] + let ``Matrix multiplication by scalar is the same as row multiplication by scalar`` (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, scalar : float32) = + let A = Matrix4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) + + let R1 = Vector4(a, b, c, d) * scalar + let R2 = Vector4(e, f, g, h) * scalar + let R3 = Vector4(i, j, k, l) * scalar + let R4 = Vector4(m, n, o, p) * scalar + + let AScaled = A * scalar + + Assert.Equal(R1, AScaled.Row0) + Assert.Equal(R2, AScaled.Row1) + Assert.Equal(R3, AScaled.Row2) + Assert.Equal(R4, AScaled.Row3) + + [] + let ``Static method matrix multiplication by scalar is the same as row multiplication by scalar`` (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, scalar : float32) = + let A = Matrix4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) + + let R1 = Vector4(a, b, c, d) * scalar + let R2 = Vector4(e, f, g, h) * scalar + let R3 = Vector4(i, j, k, l) * scalar + let R4 = Vector4(m, n, o, p) * scalar + + let AScaled = Matrix4.Mult(A, scalar) + + Assert.Equal(R1, AScaled.Row0) + Assert.Equal(R2, AScaled.Row1) + Assert.Equal(R3, AScaled.Row2) + Assert.Equal(R4, AScaled.Row3) + + [] + let ``Static method matrix multiplication by reference by scalar is the same as row multiplication by scalar`` (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, scalar : float32) = + let A = Matrix4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) + + let R1 = Vector4(a, b, c, d) * scalar + let R2 = Vector4(e, f, g, h) * scalar + let R3 = Vector4(i, j, k, l) * scalar + let R4 = Vector4(m, n, o, p) * scalar + + let AScaled = Matrix4.Mult(ref A, scalar) + + Assert.Equal(R1, AScaled.Row0) + Assert.Equal(R2, AScaled.Row1) + Assert.Equal(R3, AScaled.Row2) + Assert.Equal(R4, AScaled.Row3) + + + [ |])>] + module Addition = + // + [] + let ``Matrix addition adds corresponding components`` (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) = + let A = Matrix4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) + let B = Matrix4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) + + let sum = A + B + + Assert.Equal(a + a, sum.M11) + Assert.Equal(b + b, sum.M12) + Assert.Equal(c + c, sum.M13) + Assert.Equal(d + d, sum.M14) + + Assert.Equal(e + e, sum.M21) + Assert.Equal(f + f, sum.M22) + Assert.Equal(g + g, sum.M23) + Assert.Equal(h + h, sum.M24) + + Assert.Equal(i + i, sum.M31) + Assert.Equal(j + j, sum.M32) + Assert.Equal(k + k, sum.M33) + Assert.Equal(l + l, sum.M34) + + Assert.Equal(m + m, sum.M41) + Assert.Equal(n + n, sum.M42) + Assert.Equal(o + o, sum.M43) + Assert.Equal(p + p, sum.M44) + + [ |])>] + module Subtraction = + // + [] + let ``Matrix subtraction subtracts corresponding components`` (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) = + let A = Matrix4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) + let B = Matrix4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) + + let sub = A - B + + Assert.Equal(a - a, sub.M11) + Assert.Equal(b - b, sub.M12) + Assert.Equal(c - c, sub.M13) + Assert.Equal(d - d, sub.M14) + + Assert.Equal(e - e, sub.M21) + Assert.Equal(f - f, sub.M22) + Assert.Equal(g - g, sub.M23) + Assert.Equal(h - h, sub.M24) + + Assert.Equal(i - i, sub.M31) + Assert.Equal(j - j, sub.M32) + Assert.Equal(k - k, sub.M33) + Assert.Equal(l - l, sub.M34) + + Assert.Equal(m - m, sub.M41) + Assert.Equal(n - n, sub.M42) + Assert.Equal(o - o, sub.M43) + Assert.Equal(p - p, sub.M44) + + [ |])>] + module Indexing = + // + [] + let ``Matrix set indexing sets correct components`` (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) = + let mutable A = Matrix4() + + A.[0, 0] <- a + A.[0, 1] <- b + A.[0, 2] <- c + A.[0, 3] <- d + + A.[1, 0] <- e + A.[1, 1] <- f + A.[1, 2] <- g + A.[1, 3] <- h + + A.[2, 0] <- i + A.[2, 1] <- j + A.[2, 2] <- k + A.[2, 3] <- l + + A.[3, 0] <- m + A.[3, 1] <- n + A.[3, 2] <- o + A.[3, 3] <- p + + Assert.Equal(a, A.M11) + Assert.Equal(b, A.M12) + Assert.Equal(c, A.M13) + Assert.Equal(d, A.M14) + + Assert.Equal(e, A.M21) + Assert.Equal(f, A.M22) + Assert.Equal(g, A.M23) + Assert.Equal(h, A.M24) + + Assert.Equal(i, A.M31) + Assert.Equal(j, A.M32) + Assert.Equal(k, A.M33) + Assert.Equal(l, A.M34) + + Assert.Equal(m, A.M41) + Assert.Equal(n, A.M42) + Assert.Equal(o, A.M43) + Assert.Equal(p, A.M44) + + [] + let ``Matrix get indexing accesses the correct components`` (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) = + let A = Matrix4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) + + Assert.Equal(a, A.[0, 0]) + Assert.Equal(b, A.[0, 1]) + Assert.Equal(c, A.[0, 2]) + Assert.Equal(d, A.[0, 3]) + + Assert.Equal(e, A.[1, 0]) + Assert.Equal(f, A.[1, 1]) + Assert.Equal(g, A.[1, 2]) + Assert.Equal(h, A.[1, 3]) + + Assert.Equal(i, A.[2, 0]) + Assert.Equal(j, A.[2, 1]) + Assert.Equal(k, A.[2, 2]) + Assert.Equal(l, A.[2, 3]) + + Assert.Equal(m, A.[3, 0]) + Assert.Equal(n, A.[3, 1]) + Assert.Equal(o, A.[3, 2]) + Assert.Equal(p, A.[3, 3]) + + + [] + let ``Indexed set operator throws exception for negative indices`` (b : Matrix4, x : float32) = + let mutable a = b + + + + (fun() -> a.[-1, 2] <- x) |> Assert.ThrowsIndexExn + (fun() -> a.[1, -2] <- x) |> Assert.ThrowsIndexExn + (fun() -> a.[-1, -2] <- x) |> Assert.ThrowsIndexExn + + [] + let ``Indexed get operator throws exception for negative indices`` (a : Matrix4) = + (fun() -> a.[-1, 2] |> ignore) |> Assert.ThrowsIndexExn + (fun() -> a.[1, -2] |> ignore) |> Assert.ThrowsIndexExn + (fun() -> a.[-1, -2] |> ignore) |> Assert.ThrowsIndexExn + + [] + let ``Indexed set operator throws exception for large indices`` (a : Matrix4, x : float32) = + let mutable b = a + (fun() -> b.[5, 2] <- x) |> Assert.ThrowsIndexExn + (fun() -> b.[1, 6] <- x) |> Assert.ThrowsIndexExn + (fun() -> b.[7, 12] <- x) |> Assert.ThrowsIndexExn + + [] + let ``Indexed get operator throws exception for large indices`` (a : Matrix4) = + (fun() -> a.[5, 2] |> ignore) |> Assert.ThrowsIndexExn + (fun() -> a.[1, 6] |> ignore) |> Assert.ThrowsIndexExn + (fun() -> a.[7, 12] |> ignore) |> Assert.ThrowsIndexExn + + [ |])>] + module ``Row and column properties`` = + // + [] + let ``Matrix row properties return the correct components`` (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) = + let A = Matrix4(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) + + let R0 = A.Row0 + let R1 = A.Row1 + let R2 = A.Row2 + let R3 = A.Row3 + + Assert.Equal(a, R0.X) + Assert.Equal(b, R0.Y) + Assert.Equal(c, R0.Z) + Assert.Equal(d, R0.W) + + Assert.Equal(e, R1.X) + Assert.Equal(f, R1.Y) + Assert.Equal(g, R1.Z) + Assert.Equal(h, R1.W) + + Assert.Equal(i, R2.X) + Assert.Equal(j, R2.Y) + Assert.Equal(k, R2.Z) + Assert.Equal(l, R2.W) + + Assert.Equal(m, R3.X) + Assert.Equal(n, R3.Y) + Assert.Equal(o, R3.Z) + Assert.Equal(p, R3.W) \ No newline at end of file diff --git a/tests/OpenTK.Tests/OpenTK.Tests.csproj b/tests/OpenTK.Tests/OpenTK.Tests.csproj deleted file mode 100644 index f4d82e04..00000000 --- a/tests/OpenTK.Tests/OpenTK.Tests.csproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - - Debug - AnyCPU - {930A780C-A67C-422F-9EED-DB38DAA47AB0} - Library - Properties - OpenTK.Tests - OpenTK.Tests - v4.0 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.dll - False - - - ..\..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.interfaces.dll - False - - - ..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll - True - - - ..\..\packages\NUnitTestAdapter.2.0.0\lib\nunit.util.dll - False - - - ..\..\packages\NUnitTestAdapter.2.0.0\lib\NUnit.VisualStudio.TestAdapter.dll - False - - - - - - - - - - - - - - - - - - - - {a37a7e14-0000-0000-0000-000000000000} - OpenTK - - - - - - - - \ No newline at end of file diff --git a/tests/OpenTK.Tests/OpenTK.Tests.fsproj b/tests/OpenTK.Tests/OpenTK.Tests.fsproj new file mode 100644 index 00000000..ee3974a9 --- /dev/null +++ b/tests/OpenTK.Tests/OpenTK.Tests.fsproj @@ -0,0 +1,1684 @@ + + + + + Debug + AnyCPU + 2.0 + 6801c263-adda-4a7b-979d-649bcb5a1df7 + Library + OpenTK.Tests + OpenTK.Tests + v4.5.2 + 4.4.0.0 + true + OpenTK.Tests + true + Program + packages\xunit.runner.console\tools\xunit.console.exe + OpenTK.Tests.dll + + + true + full + false + false + bin\Debug\ + DEBUG;TRACE + 3 + bin\Debug\OpenTK.Tests.XML + + + pdbonly + true + true + bin\Release\ + TRACE + 3 + bin\Release\OpenTK.Tests.XML + + + 11 + + + + + $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets + + + + + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets + + + + + + + + + + + + + + + + + + + + + + + + + OpenTK + {a37a7e14-0000-0000-0000-000000000000} + True + + + + + + + ..\..\packages\FsCheck\lib\net452\FsCheck.dll + True + True + + + + + + + ..\..\packages\FsCheck\lib\netstandard1.6\FsCheck.dll + True + True + + + + + + + ..\..\packages\FsCheck\lib\portable-net45+netcore45\FsCheck.dll + True + True + + + + + + + ..\..\packages\FsCheck\lib\portable-net45+netcore45+wp8\FsCheck.dll + True + True + + + + + + + ..\..\packages\FsCheck\lib\portable-net45+netcore45+wpa81+wp8\FsCheck.dll + True + True + + + + + + + + + ..\..\packages\FsCheck.Xunit\lib\net452\FsCheck.Xunit.dll + True + True + + + + + + + ..\..\packages\FsCheck.Xunit\lib\netstandard1.6\FsCheck.Xunit.dll + True + True + + + + + + + + + ..\..\packages\FSharp.Core\lib\net45\FSharp.Core.dll + True + True + + + + + + + ..\..\packages\FSharp.Core\lib\netstandard1.6\FSharp.Core.dll + True + True + + + + + + + + + ..\..\packages\Microsoft.Win32.Primitives\ref\netstandard1.3\Microsoft.Win32.Primitives.dll + False + True + + + + + + + + + ..\..\packages\System.AppContext\ref\netstandard1.3\System.AppContext.dll + False + True + + + + + + + ..\..\packages\System.AppContext\lib\netstandard1.6\System.AppContext.dll + True + True + + + + + + + ..\..\packages\System.AppContext\ref\netstandard1.6\System.AppContext.dll + False + True + + + + + + + + + ..\..\packages\System.Buffers\lib\netstandard1.1\System.Buffers.dll + True + True + + + + + + + + + ..\..\packages\System.Collections\ref\netstandard1.0\System.Collections.dll + False + True + + + + + + + ..\..\packages\System.Collections\ref\netstandard1.3\System.Collections.dll + False + True + + + + + + + + + ..\..\packages\System.Collections.Concurrent\ref\netstandard1.1\System.Collections.Concurrent.dll + False + True + + + + + + + ..\..\packages\System.Collections.Concurrent\lib\netstandard1.3\System.Collections.Concurrent.dll + True + True + + + + + + + ..\..\packages\System.Collections.Concurrent\ref\netstandard1.3\System.Collections.Concurrent.dll + False + True + + + + + + + + + ..\..\packages\System.Console\lib\net46\System.Console.dll + True + True + + + + + + + ..\..\packages\System.Console\ref\netstandard1.3\System.Console.dll + False + True + + + + + + + + + ..\..\packages\System.Diagnostics.Debug\ref\netstandard1.0\System.Diagnostics.Debug.dll + False + True + + + + + + + ..\..\packages\System.Diagnostics.Debug\ref\netstandard1.3\System.Diagnostics.Debug.dll + False + True + + + + + + + + + ..\..\packages\System.Diagnostics.DiagnosticSource\lib\netstandard1.3\System.Diagnostics.DiagnosticSource.dll + True + True + + + + + + + + + ..\..\packages\System.Diagnostics.Tools\ref\netstandard1.0\System.Diagnostics.Tools.dll + False + True + + + + + + + + + ..\..\packages\System.Diagnostics.Tracing\ref\netstandard1.1\System.Diagnostics.Tracing.dll + False + True + + + + + + + ..\..\packages\System.Diagnostics.Tracing\ref\netstandard1.2\System.Diagnostics.Tracing.dll + False + True + + + + + + + ..\..\packages\System.Diagnostics.Tracing\ref\netstandard1.3\System.Diagnostics.Tracing.dll + False + True + + + + + + + ..\..\packages\System.Diagnostics.Tracing\ref\netstandard1.5\System.Diagnostics.Tracing.dll + False + True + + + + + + + + + ..\..\packages\System.Globalization\ref\netstandard1.0\System.Globalization.dll + False + True + + + + + + + ..\..\packages\System.Globalization\ref\netstandard1.3\System.Globalization.dll + False + True + + + + + + + + + ..\..\packages\System.Globalization.Calendars\ref\netstandard1.3\System.Globalization.Calendars.dll + False + True + + + + + + + + + ..\..\packages\System.Globalization.Extensions\ref\netstandard1.3\System.Globalization.Extensions.dll + False + True + + + + + + + + + ..\..\packages\System.IO\lib\net462\System.IO.dll + True + True + + + + + + + ..\..\packages\System.IO\ref\netstandard1.0\System.IO.dll + False + True + + + + + + + ..\..\packages\System.IO\ref\netstandard1.3\System.IO.dll + False + True + + + + + + + ..\..\packages\System.IO\ref\netstandard1.5\System.IO.dll + False + True + + + + + + + + + True + + + + + + + True + + + + + + + True + + + + + + + ..\..\packages\System.IO.Compression\ref\netstandard1.1\System.IO.Compression.dll + False + True + + + + + + + ..\..\packages\System.IO.Compression\ref\netstandard1.3\System.IO.Compression.dll + False + True + + + + + + + True + + + + + + + True + + + + + + + True + + + + + + + True + + + + + + + + + ..\..\packages\System.IO.Compression.ZipFile\lib\netstandard1.3\System.IO.Compression.ZipFile.dll + True + True + + + + + + + ..\..\packages\System.IO.Compression.ZipFile\ref\netstandard1.3\System.IO.Compression.ZipFile.dll + False + True + + + + + + + + + ..\..\packages\System.IO.FileSystem\ref\netstandard1.3\System.IO.FileSystem.dll + False + True + + + + + + + + + ..\..\packages\System.IO.FileSystem.Primitives\lib\netstandard1.3\System.IO.FileSystem.Primitives.dll + True + True + + + + + + + ..\..\packages\System.IO.FileSystem.Primitives\ref\netstandard1.3\System.IO.FileSystem.Primitives.dll + False + True + + + + + + + + + ..\..\packages\System.Linq\lib\net463\System.Linq.dll + True + True + + + + + + + ..\..\packages\System.Linq\ref\netstandard1.0\System.Linq.dll + False + True + + + + + + + ..\..\packages\System.Linq\lib\netstandard1.6\System.Linq.dll + True + True + + + + + + + ..\..\packages\System.Linq\ref\netstandard1.6\System.Linq.dll + False + True + + + + + + + + + ..\..\packages\System.Linq.Expressions\lib\net463\System.Linq.Expressions.dll + True + True + + + + + + + ..\..\packages\System.Linq.Expressions\ref\netstandard1.0\System.Linq.Expressions.dll + False + True + + + + + + + ..\..\packages\System.Linq.Expressions\ref\netstandard1.3\System.Linq.Expressions.dll + False + True + + + + + + + ..\..\packages\System.Linq.Expressions\lib\netstandard1.6\System.Linq.Expressions.dll + True + True + + + + + + + ..\..\packages\System.Linq.Expressions\ref\netstandard1.6\System.Linq.Expressions.dll + False + True + + + + + + + + + ..\..\packages\System.Linq.Queryable\ref\netstandard1.0\System.Linq.Queryable.dll + False + True + + + + + + + ..\..\packages\System.Linq.Queryable\lib\netstandard1.3\System.Linq.Queryable.dll + True + True + + + + + + + + + True + + + + + + + True + + + + + + + True + + + + + + + True + + + + + + + ..\..\packages\System.Net.Http\ref\netstandard1.1\System.Net.Http.dll + False + True + + + + + + + ..\..\packages\System.Net.Http\ref\netstandard1.3\System.Net.Http.dll + False + True + + + + + + + True + + + + + + + True + + + + + + + True + + + + + + + + + ..\..\packages\System.Net.Primitives\ref\netstandard1.1\System.Net.Primitives.dll + False + True + + + + + + + ..\..\packages\System.Net.Primitives\ref\netstandard1.3\System.Net.Primitives.dll + False + True + + + + + + + + + ..\..\packages\System.Net.Requests\ref\netstandard1.3\System.Net.Requests.dll + False + True + + + + + + + + + ..\..\packages\System.Net.Sockets\ref\netstandard1.3\System.Net.Sockets.dll + False + True + + + + + + + + + ..\..\packages\System.Net.WebHeaderCollection\lib\netstandard1.3\System.Net.WebHeaderCollection.dll + True + True + + + + + + + ..\..\packages\System.Net.WebHeaderCollection\ref\netstandard1.3\System.Net.WebHeaderCollection.dll + False + True + + + + + + + + + ..\..\packages\System.ObjectModel\ref\netstandard1.0\System.ObjectModel.dll + False + True + + + + + + + ..\..\packages\System.ObjectModel\lib\netstandard1.3\System.ObjectModel.dll + True + True + + + + + + + ..\..\packages\System.ObjectModel\ref\netstandard1.3\System.ObjectModel.dll + False + True + + + + + + + + + ..\..\packages\System.Reflection\lib\net462\System.Reflection.dll + True + True + + + + + + + ..\..\packages\System.Reflection\ref\netstandard1.0\System.Reflection.dll + False + True + + + + + + + ..\..\packages\System.Reflection\ref\netstandard1.3\System.Reflection.dll + False + True + + + + + + + ..\..\packages\System.Reflection\ref\netstandard1.5\System.Reflection.dll + False + True + + + + + + + + + ..\..\packages\System.Reflection.Emit\ref\netstandard1.1\System.Reflection.Emit.dll + False + True + + + + + + + ..\..\packages\System.Reflection.Emit\lib\netstandard1.3\System.Reflection.Emit.dll + True + True + + + + + + + + + ..\..\packages\System.Reflection.Emit.ILGeneration\ref\netstandard1.0\System.Reflection.Emit.ILGeneration.dll + False + True + + + + + + + ..\..\packages\System.Reflection.Emit.ILGeneration\lib\netstandard1.3\System.Reflection.Emit.ILGeneration.dll + True + True + + + + + + + + + ..\..\packages\System.Reflection.Emit.Lightweight\ref\netstandard1.0\System.Reflection.Emit.Lightweight.dll + False + True + + + + + + + ..\..\packages\System.Reflection.Emit.Lightweight\lib\netstandard1.3\System.Reflection.Emit.Lightweight.dll + True + True + + + + + + + + + ..\..\packages\System.Reflection.Extensions\ref\netstandard1.0\System.Reflection.Extensions.dll + False + True + + + + + + + + + ..\..\packages\System.Reflection.Primitives\ref\netstandard1.0\System.Reflection.Primitives.dll + False + True + + + + + + + + + ..\..\packages\System.Reflection.TypeExtensions\lib\net462\System.Reflection.TypeExtensions.dll + True + True + + + + + + + ..\..\packages\System.Reflection.TypeExtensions\lib\netstandard1.5\System.Reflection.TypeExtensions.dll + True + True + + + + + + + ..\..\packages\System.Reflection.TypeExtensions\ref\netstandard1.5\System.Reflection.TypeExtensions.dll + False + True + + + + + + + + + ..\..\packages\System.Resources.ResourceManager\ref\netstandard1.0\System.Resources.ResourceManager.dll + False + True + + + + + + + + + True + + + + + + + True + + + ..\..\packages\System.Runtime\lib\net462\System.Runtime.dll + True + True + + + + + + + ..\..\packages\System.Runtime\ref\netstandard1.0\System.Runtime.dll + False + True + + + + + + + ..\..\packages\System.Runtime\ref\netstandard1.2\System.Runtime.dll + False + True + + + + + + + ..\..\packages\System.Runtime\ref\netstandard1.3\System.Runtime.dll + False + True + + + + + + + ..\..\packages\System.Runtime\ref\netstandard1.5\System.Runtime.dll + False + True + + + + + + + + + ..\..\packages\System.Runtime.Extensions\lib\net462\System.Runtime.Extensions.dll + True + True + + + + + + + ..\..\packages\System.Runtime.Extensions\ref\netstandard1.0\System.Runtime.Extensions.dll + False + True + + + + + + + ..\..\packages\System.Runtime.Extensions\ref\netstandard1.3\System.Runtime.Extensions.dll + False + True + + + + + + + ..\..\packages\System.Runtime.Extensions\ref\netstandard1.5\System.Runtime.Extensions.dll + False + True + + + + + + + + + ..\..\packages\System.Runtime.Handles\ref\netstandard1.3\System.Runtime.Handles.dll + False + True + + + + + + + + + ..\..\packages\System.Runtime.InteropServices\ref\netcoreapp1.1\System.Runtime.InteropServices.dll + False + True + + + + + + + ..\..\packages\System.Runtime.InteropServices\ref\netstandard1.1\System.Runtime.InteropServices.dll + False + True + + + + + + + ..\..\packages\System.Runtime.InteropServices\ref\netstandard1.2\System.Runtime.InteropServices.dll + False + True + + + + + + + ..\..\packages\System.Runtime.InteropServices\ref\netstandard1.3\System.Runtime.InteropServices.dll + False + True + + + + + + + ..\..\packages\System.Runtime.InteropServices\ref\netstandard1.5\System.Runtime.InteropServices.dll + False + True + + + + + + + + + ..\..\packages\System.Runtime.InteropServices.RuntimeInformation\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll + True + True + + + + + + + ..\..\packages\System.Runtime.InteropServices.RuntimeInformation\lib\netstandard1.1\System.Runtime.InteropServices.RuntimeInformation.dll + True + True + + + + + + + ..\..\packages\System.Runtime.InteropServices.RuntimeInformation\ref\netstandard1.1\System.Runtime.InteropServices.RuntimeInformation.dll + False + True + + + + + + + ..\..\packages\System.Runtime.InteropServices.RuntimeInformation\lib\wpa81\System.Runtime.InteropServices.RuntimeInformation.dll + True + True + + + + + + + + + ..\..\packages\System.Runtime.Numerics\ref\netstandard1.1\System.Runtime.Numerics.dll + False + True + + + + + + + ..\..\packages\System.Runtime.Numerics\lib\netstandard1.3\System.Runtime.Numerics.dll + True + True + + + + + + + + + ..\..\packages\System.Security.Cryptography.Algorithms\ref\netstandard1.3\System.Security.Cryptography.Algorithms.dll + False + True + + + + + + + ..\..\packages\System.Security.Cryptography.Algorithms\ref\netstandard1.4\System.Security.Cryptography.Algorithms.dll + False + True + + + + + + + ..\..\packages\System.Security.Cryptography.Algorithms\ref\netstandard1.6\System.Security.Cryptography.Algorithms.dll + False + True + + + + + + + + + ..\..\packages\System.Security.Cryptography.Cng\ref\netstandard1.6\System.Security.Cryptography.Cng.dll + False + True + + + + + + + + + ..\..\packages\System.Security.Cryptography.Csp\ref\netstandard1.3\System.Security.Cryptography.Csp.dll + False + True + + + + + + + + + ..\..\packages\System.Security.Cryptography.Encoding\ref\netstandard1.3\System.Security.Cryptography.Encoding.dll + False + True + + + + + + + + + ..\..\packages\System.Security.Cryptography.OpenSsl\lib\netstandard1.6\System.Security.Cryptography.OpenSsl.dll + True + True + + + + + + + ..\..\packages\System.Security.Cryptography.OpenSsl\ref\netstandard1.6\System.Security.Cryptography.OpenSsl.dll + False + True + + + + + + + + + ..\..\packages\System.Security.Cryptography.Primitives\lib\netstandard1.3\System.Security.Cryptography.Primitives.dll + True + True + + + + + + + ..\..\packages\System.Security.Cryptography.Primitives\ref\netstandard1.3\System.Security.Cryptography.Primitives.dll + False + True + + + + + + + + + ..\..\packages\System.Security.Cryptography.X509Certificates\ref\netstandard1.3\System.Security.Cryptography.X509Certificates.dll + False + True + + + + + + + ..\..\packages\System.Security.Cryptography.X509Certificates\ref\netstandard1.4\System.Security.Cryptography.X509Certificates.dll + False + True + + + + + + + + + ..\..\packages\System.Text.Encoding\ref\netstandard1.0\System.Text.Encoding.dll + False + True + + + + + + + ..\..\packages\System.Text.Encoding\ref\netstandard1.3\System.Text.Encoding.dll + False + True + + + + + + + + + ..\..\packages\System.Text.Encoding.Extensions\ref\netstandard1.0\System.Text.Encoding.Extensions.dll + False + True + + + + + + + ..\..\packages\System.Text.Encoding.Extensions\ref\netstandard1.3\System.Text.Encoding.Extensions.dll + False + True + + + + + + + + + ..\..\packages\System.Text.RegularExpressions\ref\netcoreapp1.1\System.Text.RegularExpressions.dll + False + True + + + + + + + ..\..\packages\System.Text.RegularExpressions\ref\netstandard1.0\System.Text.RegularExpressions.dll + False + True + + + + + + + ..\..\packages\System.Text.RegularExpressions\ref\netstandard1.3\System.Text.RegularExpressions.dll + False + True + + + + + + + ..\..\packages\System.Text.RegularExpressions\lib\netstandard1.6\System.Text.RegularExpressions.dll + True + True + + + + + + + ..\..\packages\System.Text.RegularExpressions\ref\netstandard1.6\System.Text.RegularExpressions.dll + False + True + + + + + + + + + ..\..\packages\System.Threading\ref\netstandard1.0\System.Threading.dll + False + True + + + + + + + ..\..\packages\System.Threading\lib\netstandard1.3\System.Threading.dll + True + True + + + + + + + ..\..\packages\System.Threading\ref\netstandard1.3\System.Threading.dll + False + True + + + + + + + + + ..\..\packages\System.Threading.Tasks\ref\netstandard1.0\System.Threading.Tasks.dll + False + True + + + + + + + ..\..\packages\System.Threading.Tasks\ref\netstandard1.3\System.Threading.Tasks.dll + False + True + + + + + + + + + ..\..\packages\System.Threading.Tasks.Extensions\lib\netstandard1.0\System.Threading.Tasks.Extensions.dll + True + True + + + + + + + + + ..\..\packages\System.Threading.Tasks.Parallel\ref\netstandard1.1\System.Threading.Tasks.Parallel.dll + False + True + + + + + + + ..\..\packages\System.Threading.Tasks.Parallel\lib\netstandard1.3\System.Threading.Tasks.Parallel.dll + True + True + + + + + + + + + ..\..\packages\System.Threading.Thread\lib\netstandard1.3\System.Threading.Thread.dll + True + True + + + + + + + ..\..\packages\System.Threading.Thread\ref\netstandard1.3\System.Threading.Thread.dll + False + True + + + + + + + + + ..\..\packages\System.Threading.ThreadPool\lib\netstandard1.3\System.Threading.ThreadPool.dll + True + True + + + + + + + ..\..\packages\System.Threading.ThreadPool\ref\netstandard1.3\System.Threading.ThreadPool.dll + False + True + + + + + + + + + ..\..\packages\System.Threading.Timer\ref\netstandard1.2\System.Threading.Timer.dll + False + True + + + + + + + + + True + + + + + + + ..\..\packages\System.Xml.ReaderWriter\ref\netstandard1.0\System.Xml.ReaderWriter.dll + False + True + + + + + + + ..\..\packages\System.Xml.ReaderWriter\lib\netstandard1.3\System.Xml.ReaderWriter.dll + True + True + + + + + + + ..\..\packages\System.Xml.ReaderWriter\ref\netstandard1.3\System.Xml.ReaderWriter.dll + False + True + + + + + + + + + True + + + + + + + ..\..\packages\System.Xml.XDocument\ref\netstandard1.0\System.Xml.XDocument.dll + False + True + + + + + + + ..\..\packages\System.Xml.XDocument\lib\netstandard1.3\System.Xml.XDocument.dll + True + True + + + + + + + ..\..\packages\System.Xml.XDocument\ref\netstandard1.3\System.Xml.XDocument.dll + False + True + + + + + + + + + ..\..\packages\xunit.abstractions\lib\net35\xunit.abstractions.dll + True + True + + + + + + + ..\..\packages\xunit.abstractions\lib\netstandard1.0\xunit.abstractions.dll + True + True + + + + + + + + + ..\..\packages\xunit.assert\lib\netstandard1.1\xunit.assert.dll + True + True + + + + + + + + + ..\..\packages\xunit.extensibility.core\lib\netstandard1.1\xunit.core.dll + True + True + + + + + + + + + ..\..\packages\xunit.extensibility.execution\lib\net452\xunit.execution.desktop.dll + True + True + + + + + + + ..\..\packages\xunit.extensibility.execution\lib\netstandard1.1\xunit.execution.dotnet.dll + True + True + + + + + \ No newline at end of file diff --git a/tests/OpenTK.Tests/Properties/AssemblyInfo.cs b/tests/OpenTK.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index fac1b001..00000000 --- a/tests/OpenTK.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// 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: AssemblyTitle("OpenTK.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("OpenTK.Tests")] -[assembly: AssemblyCopyright("Copyright © 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("8a03c40d-007c-4a15-ab0c-2111969ea6df")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/tests/OpenTK.Tests/Vector2Tests.fs b/tests/OpenTK.Tests/Vector2Tests.fs new file mode 100644 index 00000000..6e352259 --- /dev/null +++ b/tests/OpenTK.Tests/Vector2Tests.fs @@ -0,0 +1,613 @@ +namespace OpenTK.Tests + +open Xunit +open FsCheck +open FsCheck.Xunit +open System +open System.Runtime.InteropServices +open OpenTK + +module Vector2 = + [ |])>] + module Constructors = + // + [] + let ``Single value constructor sets all components to the same value`` (f : float32) = + let v = Vector2(f) + Assert.Equal(f,v.X) + Assert.Equal(f,v.Y) + + [] + let ``Two value constructor sets all components correctly`` (x,y) = + let v = Vector2(x,y) + Assert.Equal(x,v.X) + Assert.Equal(y,v.Y) + + [ |])>] + module Clamping = + // + [] + let ``Clamping one vector between two other vectors clamps all components between corresponding components`` (a : Vector2, b : Vector2, w : Vector2) = + let res = Vector2.Clamp(w, a, b) + + let expX = if w.X < a.X then a.X else if w.X > b.X then b.X else w.X + let expY = if w.Y < a.Y then a.Y else if w.Y > b.Y then b.Y else w.Y + + Assert.Equal(expX, res.X) + Assert.Equal(expY, res.Y) + + [] + let ``Clamping one vector between two other vectors by reference clamps all components`` (a : Vector2, b : Vector2, w : Vector2) = + let res = Vector2.Clamp(ref w, ref a, ref b) + + let expX = if w.X < a.X then a.X else if w.X > b.X then b.X else w.X + let expY = if w.Y < a.Y then a.Y else if w.Y > b.Y then b.Y else w.Y + + Assert.Equal(expX, res.X) + Assert.Equal(expY, res.Y) + + [ |])>] + module Length = + // + [] + let ``Length is always >= 0`` (a : Vector2) = + // + Assert.True(a.Length >= 0.0f) + + [] + let ``Length follows the pythagorean theorem`` (a, b) = + let v = Vector2(a, b) + let l = System.Math.Sqrt((float)(a * a + b * b)) + + Assert.Equal((float32)l, v.Length) + + [] + let ``Fast length method works`` (a, b) = + let v = Vector2(a, b) + let l = 1.0f / MathHelper.InverseSqrtFast(a * a + b * b) + + Assert.Equal(l, v.LengthFast) + + [] + let ``Length squared method works`` (a, b) = + let v = Vector2(a, b) + let lsq = a * a + b * b + + Assert.Equal(lsq, v.LengthSquared) + + [ |])>] + module Distance = + [] + let ``Distance(a, b) = (b - a).Length`` (a : Vector2, b : Vector2) = + Assert.ApproximatelyEqual(Vector2.Distance(a, b), (b - a).Length) + + [] + let ``DistanceSquared(a, b) = (b - a).LengthSquared`` (a : Vector2, b : Vector2) = + Assert.ApproximatelyEqual(Vector2.DistanceSquared(a, b), (b - a).LengthSquared) + + [ |])>] + module ``Unit vectors and perpendicularity`` = + // + [] + let ``Perpendicular vector to the right is correct`` (a, b) = + let v = Vector2(a, b) + let perp = Vector2(b, -a) + + Assert.Equal(perp, v.PerpendicularRight) + + [] + let ``Perpendicular vector to the left is correct`` (a, b) = + let v = Vector2(a, b) + let perp = Vector2(-b, a) + + Assert.Equal(perp, v.PerpendicularLeft) + + [ |])>] + module Indexing = + // + [] + let ``Index operator accesses the correct components`` (x, y) = + let v = Vector2(x, y) + + Assert.Equal(x, v.[0]) + Assert.Equal(y, v.[1]) + + [] + let ``Indexed set operator throws exception for negative indices`` (x, y) = + let mutable v = Vector2(x, y) + + (fun() -> v.[-1] <- x) |> Assert.ThrowsIndexExn + + [] + let ``Indexed get operator throws exception for negative indices`` (x, y) = + let mutable v = Vector2(x, y) + + (fun() -> v.[-1] |> ignore) |> Assert.ThrowsIndexExn + + [] + let ``Indexed set operator throws exception for large indices`` (x, y) = + let mutable v = Vector2(x, y) + + (fun() -> v.[2] <- x) |> Assert.ThrowsIndexExn + + [] + let ``Indexed get operator throws exception for large indices`` (x, y) = + let mutable v = Vector2(x, y) + + (fun() -> v.[2] |> ignore) |> Assert.ThrowsIndexExn + + [ |])>] + module ``Simple Properties`` = + // + [] + let ``Vector equality is by component`` (a : Vector2,b : Vector2) = + // + Assert.Equal((a.X = b.X && a.Y = b.Y),(a = b)) + + [] + let ``Vector length is always >= 0`` (a : Vector2) = + // + Assert.True(a.Length >= 0.0f) + + [ |])>] + module Addition = + // + [] + let ``Vector addition is the same as component addition`` (a : Vector2,b : Vector2) = + let c = a + b + Assert.ApproximatelyEquivalent(a.X + b.X,c.X) + Assert.ApproximatelyEquivalent(a.Y + b.Y,c.Y) + + [] + let ``Vector addition is commutative`` (a : Vector2,b : Vector2) = + let c = a + b + let c2 = b + a + Assert.ApproximatelyEquivalent(c,c2) + + [] + let ``Vector addition is associative`` (a : Vector2,b : Vector2,c : Vector2) = + let r1 = (a + b) + c + let r2 = a + (b + c) + Assert.ApproximatelyEquivalent(r1,r2) + + [] + let ``Static Vector2 addition method is the same as component addition`` (a : Vector2, b : Vector2) = + + let v1 = Vector2(a.X + b.X, a.Y + b.Y) + let sum = Vector2.Add(a, b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [] + let ``Static Vector2 addition method by reference is the same as component addition`` (a : Vector2, b : Vector2) = + + let v1 = Vector2(a.X + b.X, a.Y + b.Y) + let sum = Vector2.Add(ref a, ref b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [ |])>] + module Multiplication = + // + [] + let ``Vector2 multiplication is the same as component multiplication`` (a : Vector2, b : Vector2) = + let c = a * b + Assert.Equal(a.X * b.X,c.X) + Assert.Equal(a.Y * b.Y,c.Y) + + [] + let ``Vector2 multiplication is commutative`` (a : Vector2, b : Vector2) = + let r1 = a * b + let r2 = b * a + Assert.Equal(r1,r2) + + [] + let ``Left-handed Vector2-scalar multiplication is the same as component-scalar multiplication`` (a : Vector2, f : float32) = + let r = a * f + + Assert.Equal(a.X * f,r.X) + Assert.Equal(a.Y * f,r.Y) + + [] + let ``Right-handed Vector2-scalar multiplication is the same as component-scalar multiplication`` (a : Vector2, f : float32) = + let r = f * a + Assert.Equal(a.X * f,r.X) + Assert.Equal(a.Y * f,r.Y) + + [] + let ``Static Vector2 multiplication method is the same as component multiplication`` (a : Vector2, b : Vector2) = + + let v1 = Vector2(a.X * b.X, a.Y * b.Y) + let sum = Vector2.Multiply(a, b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [] + let ``Static Vector2 multiplication method by reference is the same as component multiplication`` (a : Vector2, b : Vector2) = + + let v1 = Vector2(a.X * b.X, a.Y * b.Y) + let sum = Vector2.Multiply(ref a, ref b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [] + let ``Static method Vector2-scalar multiplication is the same as component-scalar multiplication`` (a : Vector2, f : float32) = + let r = Vector2.Multiply(a, f) + + Assert.Equal(a.X * f,r.X) + Assert.Equal(a.Y * f,r.Y) + + [ |])>] + module Subtraction = + // + [] + let ``Vector2 subtraction is the same as component subtraction`` (a : Vector2, b : Vector2) = + let c = a - b + Assert.Equal(a.X - b.X,c.X) + Assert.Equal(a.Y - b.Y,c.Y) + + [] + let ``Static Vector2 subtraction method is the same as component addition`` (a : Vector2, b : Vector2) = + + let v1 = Vector2(a.X - b.X, a.Y - b.Y) + let sum = Vector2.Subtract(a, b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [] + let ``Static Vector2 subtraction method by reference is the same as component addition`` (a : Vector2, b : Vector2) = + + let v1 = Vector2(a.X - b.X, a.Y - b.Y) + let sum = Vector2.Subtract(ref a, ref b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [ |])>] + module Division = + // + [] + let ``Vector2-float division is the same as component-float division`` (a : Vector2, f : float32) = + if not (approxEq f 0.0f) then + let r = a / f + + Assert.ApproximatelyEquivalent(a.X / f,r.X) + Assert.ApproximatelyEquivalent(a.Y / f,r.Y) + + [] + let ``Static Vector2-Vector2 division method is the same as component division`` (a : Vector2, b : Vector2) = + if not (anyZero2 a || anyZero2 b) then + let v1 = Vector2(a.X / b.X, a.Y / b.Y) + let sum = Vector2.Divide(a, b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [] + let ``Static Vector2-Vector2 divison method by reference `` (a : Vector2, b : Vector2) = + if not (anyZero2 a || anyZero2 b) then + let v1 = Vector2(a.X / b.X, a.Y / b.Y) + let sum = Vector2.Divide(ref a, ref b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [] + let ``Static Vector2-scalar division method is the same as component division`` (a : Vector2, b : float32) = + if not (approxEq b 0.0f) then + let v1 = Vector2(a.X / b, a.Y / b) + let sum = Vector2.Divide(a, b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [] + let ``Static Vector2-scalar divison method by reference is the same as component division`` (a : Vector2, b : float32) = + if not (approxEq b 0.0f) then + let v1 = Vector2(a.X / b, a.Y / b) + let sum = Vector2.Divide(ref a, b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [ |])>] + module Negation = + // + [] + let ``Vector negation operator negates all components`` (x, y) = + let v = Vector2(x, y) + let vNeg = -v + Assert.Equal(-x, vNeg.X) + Assert.Equal(-y, vNeg.Y) + + [ |])>] + module Equality = + // + [] + let ``Vector equality operator is by component`` (x, y) = + let v1 = Vector2(x, y) + let v2 = Vector2(x, y) + let equality = v1 = v2 + + Assert.True(equality) + + [] + let ``Vector inequality operator is by component`` (x, y) = + let v1 = Vector2(x, y) + let v2 = Vector2(x + 1.0f , y + 1.0f) + let inequality = v1 <> v2 + + Assert.True(inequality) + + [] + let ``Vector equality method is by component`` (x, y) = + let v1 = Vector2(x, y) + let v2 = Vector2(x, y) + let notVector = Matrix2() + + let equality = v1.Equals(v2) + let inequalityByOtherType = v1.Equals(notVector) + + Assert.True(equality) + Assert.False(inequalityByOtherType) + + [ |])>] + module Swizzling = + // + [] + let ``Vector swizzling returns the correct composites`` (x, y) = + let v1 = Vector2(x, y) + let v2 = Vector2(y, x) + + let v1yx = v1.Yx; + Assert.Equal(v2, v1yx); + + [ |])>] + module Interpolation = + // + [] + let ``Linear interpolation is by component`` (a : Vector2, b : Vector2, q) = + + let blend = q + + let rX = blend * (b.X - a.X) + a.X + let rY = blend * (b.Y - a.Y) + a.Y + let vExp = Vector2(rX, rY) + + Assert.Equal(vExp, Vector2.Lerp(a, b, q)) + + let vRes = Vector2.Lerp(ref a, ref b, q) + Assert.Equal(vExp, vRes) + + [] + let ``Barycentric interpolation follows the barycentric formula`` (a : Vector2, b : Vector2, c : Vector2, u, v) = + + let r = a + u * (b - a) + v * (c - a) + + Assert.Equal(r, Vector2.BaryCentric(a, b, c, u, v)) + + let vRes = Vector2.BaryCentric(ref a, ref b, ref c, u, v) + Assert.Equal(r, vRes) + + [ |])>] + module ``Vector products`` = + // + [] + let ``Dot product follows the dot product formula`` (a : Vector2, b : Vector2) = + let dot = a.X * b.X + a.Y * b.Y + + Assert.Equal(dot, Vector2.Dot(a, b)); + + let vRes = Vector2.Dot(ref a, ref b) + Assert.Equal(dot, vRes) + + [] + let ``Perpendicular dot product follows the perpendicular dot product formula`` (a : Vector2, b : Vector2) = + let perpDot = a.X * b.Y - a.Y * b.X + + Assert.Equal(perpDot, Vector2.PerpDot(a, b)); + + let vRes = Vector2.PerpDot(ref a, ref b) + Assert.Equal(perpDot, vRes) + + [ |])>] + module Normalization = + // + [] + let ``Normalization creates a new unit length vector with the correct components`` (a, b) = + let v = Vector2(a, b) + let l = v.Length + + // Dividing by zero is not supported + if not (approxEq l 0.0f) then + let norm = v.Normalized() + + Assert.ApproximatelyEquivalent(v.X / l, norm.X) + Assert.ApproximatelyEquivalent(v.Y / l, norm.Y) + + [] + let ``Normalization of instance transforms the instance into a unit length vector with the correct components`` (a, b) = + let v = Vector2(a, b) + let l = v.Length + + if not (approxEq l 0.0f) then + let norm = Vector2(a, b) + norm.Normalize() + + Assert.ApproximatelyEquivalent(v.X / l, norm.X) + Assert.ApproximatelyEquivalent(v.Y / l, norm.Y) + + [] + let ``Fast approximate normalization of instance transforms the instance into a unit length vector with the correct components`` (a, b) = + let v = Vector2(a, b) + let norm = Vector2(a, b) + norm.NormalizeFast() + + let scale = MathHelper.InverseSqrtFast(a * a + b * b) + + Assert.ApproximatelyEquivalent(v.X * scale, norm.X) + Assert.ApproximatelyEquivalent(v.Y * scale, norm.Y) + + [] + let ``Normalization by reference is the same as division by magnitude`` (a : Vector2) = + // Zero-length vectors can't be normalized + if not (approxEq a.Length 0.0f) then + let norm = a / a.Length + let vRes = Vector2.Normalize(ref a) + + Assert.ApproximatelyEquivalent(norm, vRes) + + [] + let ``Normalization is the same as division by magnitude`` (a : Vector2) = + // Zero-length vectors can't be normalized + if not (approxEq a.Length 0.0f) then + let norm = a / a.Length + + Assert.ApproximatelyEquivalent(norm, Vector2.Normalize(a)); + + [] + let ``Fast approximate normalization by reference is the same as multiplication by the fast inverse square`` (a : Vector2) = + let scale = MathHelper.InverseSqrtFast(a.X * a.X + a.Y * a.Y) + + let norm = a * scale + let vRes = Vector2.NormalizeFast(ref a) + + Assert.ApproximatelyEquivalent(norm, vRes) + + [] + let ``Fast approximate normalization is the same as multiplication by the fast inverse square`` (a : Vector2) = + let scale = MathHelper.InverseSqrtFast(a.X * a.X + a.Y * a.Y) + + let norm = a * scale + + Assert.ApproximatelyEquivalent(norm, Vector2.NormalizeFast(a)); + + [ |])>] + module ``Magnitude min and max`` = + // + [] + let ``MagnitudeMin selects the vector with equal or lesser magnitude given two vectors`` (v1 : Vector2, v2: Vector2) = + // Results do not matter for equal vectors + if not (v1 = v2) then + let l1 = v1.LengthSquared + let l2 = v2.LengthSquared + + let vMin = Vector2.MagnitudeMin(v1, v2) + + if vMin = v1 then + let v1ShorterThanv2 = l1 < l2 + Assert.True(v1ShorterThanv2) + else + let v2ShorterThanOrEqualTov1 = l2 <= l1 + Assert.True(v2ShorterThanOrEqualTov1) + + [] + let ``MagnitudeMax selects the vector with equal or greater magnitude given two vectors`` (v1 : Vector2, v2: Vector2) = + // Results do not matter for equal vectors + if not (v1 = v2) then + let l1 = v1.LengthSquared + let l2 = v2.LengthSquared + + let vMin = Vector2.MagnitudeMax(v1, v2) + + if vMin = v1 then + let v1LongerThanOrEqualTov2 = l1 >= l2 + Assert.True(v1LongerThanOrEqualTov2) + else + let v2LongerThanv1 = l2 > l1 + Assert.True(v2LongerThanv1) + + [] + let ``MagnitudeMin by reference selects the vector with equal or lesser magnitude given two vectors`` (v1 : Vector2, v2: Vector2) = + // Results do not matter for equal vectors + if not (v1 = v2) then + let l1 = v1.LengthSquared + let l2 = v2.LengthSquared + + let vMin = Vector2.MagnitudeMin(ref v1, ref v2) + + if vMin = v1 then + let v1ShorterThanv2 = l1 < l2 + Assert.True(v1ShorterThanv2) + else + let v2ShorterThanOrEqualTov1 = l2 <= l1 + Assert.True(v2ShorterThanOrEqualTov1) + + [] + let ``MagnitudeMax by reference selects the vector with equal greater magnitude given two vectors`` (v1 : Vector2, v2: Vector2) = + // Results do not matter for equal vectors + if not (v1 = v2) then + let l1 = v1.LengthSquared + let l2 = v2.LengthSquared + + let vMin = Vector2.MagnitudeMax(ref v1, ref v2) + + if vMin = v1 then + let v1LongerThanOrEqualTov2 = l1 >= l2 + Assert.True(v1LongerThanOrEqualTov2) + else + let v2LongerThanv1 = l2 > l1 + Assert.True(v2LongerThanv1) + + [ |])>] + module ``Component min and max`` = + // + [] + let ``ComponentMin creates a new vector from the smallest components of given vectors`` (v1 : Vector2, v2: Vector2) = + let vMin = Vector2.ComponentMin(v1, v2) + let isComponentSmallest smallComp comp1 comp2 = smallComp <= comp1 && smallComp <= comp2 + + Assert.True(isComponentSmallest vMin.X v1.X v2.X) + Assert.True(isComponentSmallest vMin.Y v1.Y v2.Y) + + [] + let ``ComponentMax creates a new vector from the greatest components of given vectors`` (v1 : Vector2, v2: Vector2) = + let vMax = Vector2.ComponentMax(v1, v2) + let isComponentLargest largeComp comp1 comp2 = largeComp >= comp1 && largeComp >= comp2 + + Assert.True(isComponentLargest vMax.X v1.X v2.X) + Assert.True(isComponentLargest vMax.Y v1.Y v2.Y) + + [] + let ``ComponentMin by reference creates a new vector from the smallest components of given vectors`` (v1 : Vector2, v2: Vector2) = + let vMin = Vector2.ComponentMin(ref v1, ref v2) + let isComponentSmallest smallComp comp1 comp2 = smallComp <= comp1 && smallComp <= comp2 + + Assert.True(isComponentSmallest vMin.X v1.X v2.X) + Assert.True(isComponentSmallest vMin.Y v1.Y v2.Y) + + [] + let ``ComponentMax by reference creates a new vector from the greatest components of given vectors`` (v1 : Vector2, v2: Vector2) = + let vMax = Vector2.ComponentMax(ref v1, ref v2) + let isComponentLargest largeComp comp1 comp2 = largeComp >= comp1 && largeComp >= comp2 + + Assert.True(isComponentLargest vMax.X v1.X v2.X) + Assert.True(isComponentLargest vMax.Y v1.Y v2.Y) + + [ |])>] + module Transformation = + // + [] + let ``Transformation by quaternion is the same as multiplication by quaternion and its conjugate`` (v : Vector2, q : Quaternion) = + let vectorQuat = Quaternion(v.X, v.Y, 0.0f, 0.0f) + let inverse = Quaternion.Invert(q) + + let transformedQuat = q * vectorQuat * inverse + let transformedVector = Vector2(transformedQuat.X, transformedQuat.Y) + + Assert.ApproximatelyEquivalent(transformedVector, Vector2.Transform(v, q)) + + [] + let ``Transformation by quaternion by reference is the same as multiplication by quaternion and its conjugate`` (v : Vector2, q : Quaternion) = + let vectorQuat = Quaternion(v.X, v.Y, 0.0f, 0.0f) + let inverse = Quaternion.Invert(q) + + let transformedQuat = q * vectorQuat * inverse + let transformedVector = Vector2(transformedQuat.X, transformedQuat.Y) + + Assert.ApproximatelyEquivalent(transformedVector, Vector2.Transform(ref v, ref q)) + + [ |])>] + module Serialization = + // + [] + let ``The absolute size of a Vector2 is always the size of its components`` (v : Vector2) = + let expectedSize = sizeof * 2 + + Assert.Equal(expectedSize, Vector2.SizeInBytes) + Assert.Equal(expectedSize, Marshal.SizeOf(Vector2())) \ No newline at end of file diff --git a/tests/OpenTK.Tests/Vector3Tests.cs b/tests/OpenTK.Tests/Vector3Tests.cs deleted file mode 100644 index 16db4735..00000000 --- a/tests/OpenTK.Tests/Vector3Tests.cs +++ /dev/null @@ -1,439 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NUnit.Framework; -using OpenTK; - -namespace OpenTK.Tests -{ - [TestFixture] - public class Vector3Tests - { - [Test] - public void Vector3_SingleValueConstructor() - { - Vector3 V = new Vector3(1); - Assert.AreEqual(1, V.X); - Assert.AreEqual(1, V.Y); - Assert.AreEqual(1, V.Z); - } - - [Test] - public void Vector3_ThreeValueConstructor() - { - Vector3 V = new Vector3(1,2,3); - Assert.AreEqual(1, V.X); - Assert.AreEqual(2, V.Y); - Assert.AreEqual(3, V.Z); - } - - [Test] - public void Vector3_Vector2Constructor() - { - Vector2 T = new Vector2(1, 2); - Vector3 V = new Vector3(T); - Assert.AreEqual(T.X, V.X); - Assert.AreEqual(T.Y, V.Y); - Assert.AreEqual(0, V.Z); - } - - [Test] - public void Vector3_Vector3Constructor() - { - Vector3 U = new Vector3(1, 2, 3); - Vector3 V = new Vector3(U); - Assert.IsTrue(U == V); - } - - [Test] - public void Vector3_Vector4Constructor() - { - Vector4 T = new Vector4(1, 2, 3, 0); - Vector3 V = new Vector3(T); - Assert.AreEqual(T.X, V.X); - Assert.AreEqual(T.Y, V.Y); - Assert.AreEqual(T.Z, V.Z); - } - - [Test] - public void Vector3_Index_operator() - { - Vector3 V = new Vector3(); - V[0] = 1; V[1] = 2; V[2] = 3; - Assert.AreEqual(1, V[0]); - Assert.AreEqual(2, V[1]); - Assert.AreEqual(3, V[2]); - } - - [Test] - public void Vector3_Index_NegativeExceptin() - { - //the syntax for an expected exception changes from - //NUnit 2.6.4 / Microsoft Unit Test to NUnit 3+ - //but a try-catch block is always guaranteed to work - Vector3 V = new Vector3(); - bool negativeIndexExceptionFound = false; - try - { - V[-1] = 5; - } - catch (Exception) - { - negativeIndexExceptionFound = true; - } - Assert.IsTrue(negativeIndexExceptionFound); - } - - [Test] - public void Vector3_Index_LargeIndexExceptin() - { - //the syntax for an expected exception changes from - //NUnit 2.6.4 / Microsoft Unit Test to NUnit 3+ - //but a try-catch block is always guaranteed to work - Vector3 V = new Vector3(); - bool largeIndexExceptionFound = false; - try - { - V[3] = 6; - } - catch (Exception) - { - largeIndexExceptionFound = true; - } - Assert.IsTrue(largeIndexExceptionFound); - } - - [Test] - public void Vector3_Length() - { - float X = 1, Y = 2, Z = 2; - Vector3 U = new Vector3(X, Y, Z); - Assert.AreEqual((float)System.Math.Sqrt(X * X + Y * Y + Z * Z), U.Length); - } - - [Test] - public void Vector3_LengthFast() - { - float X = 1, Y = 2, Z = 2; - Vector3 U = new Vector3(X, Y, Z); - Assert.AreEqual(1.0f / MathHelper.InverseSqrtFast(X * X + Y * Y + Z * Z), U.LengthFast); - } - - [Test] - public void Vector3_Normalized() - { - float X = 2, Y = 4, Z = 16; - Vector3 U = new Vector3(X, Y, Z); - float length = U.Length; - Vector3 V = U.Normalized(); - Assert.AreEqual(U.X / length, V.X); - Assert.AreEqual(U.Y / length, V.Y); - Assert.AreEqual(U.Z / length, V.Z); - } - - [Test] - public void Vector3_NormalizeFast_Instance() - { - float X = 2, Y = 4, Z = 16; - Vector3 U = new Vector3(X, Y, Z); - Vector3 V = U; - V.NormalizeFast(); - float scale = MathHelper.InverseSqrtFast(X * X + Y * Y + Z * Z); - Assert.AreEqual(U.X * scale, V.X); - Assert.AreEqual(U.Y * scale, V.Y); - Assert.AreEqual(U.Z * scale, V.Z); - } - - [Test] - public void Vector3_Add() - { - Vector3 T = new Vector3(7, 8, 9); - Vector3 U = new Vector3(23, 89, -34); - Vector3 V = Vector3.Add(T, U); - Assert.AreEqual(T.X + U.X, V.X); - Assert.AreEqual(T.Y + U.Y, V.Y); - Assert.AreEqual(T.Z + U.Z, V.Z); - } - - [Test] - public void Vector3_Subtract() - { - Vector3 T = new Vector3(7, 8, 9); - Vector3 U = new Vector3(23, 89, -34); - Vector3 V = Vector3.Subtract(T, U); - Assert.AreEqual(T.X - U.X, V.X); - Assert.AreEqual(T.Y - U.Y, V.Y); - Assert.AreEqual(T.Z - U.Z, V.Z); - } - - [Test] - public void Vector3_Multiply_Scalar() - { - float scalar = 5.5f; - Vector3 U = new Vector3(23, 89, -34); - Vector3 V = Vector3.Multiply(U, scalar); - Assert.AreEqual(U.X * scalar, V.X); - Assert.AreEqual(U.Y * scalar, V.Y); - Assert.AreEqual(U.Z * scalar, V.Z); - } - - [Test] - public void Vector3_Multiply_Componentwise() - { - Vector3 T = new Vector3(7, 8, 0.5f); - Vector3 U = new Vector3(23, 89, -34); - Vector3 V = Vector3.Multiply(T, U); - Assert.AreEqual(T.X * U.X, V.X); - Assert.AreEqual(T.Y * U.Y, V.Y); - Assert.AreEqual(T.Z * U.Z, V.Z); - } - - [Test] - public void Vector3_Divide_Scalar() - { - float scalar = 5.5f; - Vector3 U = new Vector3(23, 89, -34); - Vector3 V = Vector3.Divide(U, scalar); - //we have to account for a small amount of round off error - //in this division test - Assert.IsTrue(Math.Abs((U.X / scalar) - V.X) < 1e-5); - Assert.IsTrue(Math.Abs((U.Y / scalar) - V.Y) < 1e-5); - Assert.IsTrue(Math.Abs((U.Z / scalar) - V.Z) < 1e-5); - } - - [Test] - public void Vector3_ComponentMin() - { - Vector3 T = new Vector3(1, 55, -100); - Vector3 U = new Vector3(24, 3, 1); - Vector3 V = Vector3.ComponentMin(T, U); - Assert.AreEqual(1, V.X); - Assert.AreEqual(3, V.Y); - Assert.AreEqual(-100, V.Z); - } - - [Test] - public void Vector3_ComponentMinOut() - { - Vector3 T = new Vector3(1, 55, -100); - Vector3 U = new Vector3(24, 3, 1); - Vector3 V; - Vector3.ComponentMin(ref T, ref U, out V); - Assert.AreEqual(1, V.X); - Assert.AreEqual(3, V.Y); - Assert.AreEqual(-100, V.Z); - } - - [Test] - public void Vector3_ComponentMax() - { - Vector3 T = new Vector3(1, 55, -100); - Vector3 U = new Vector3(24, 3, 1); - Vector3 V = Vector3.ComponentMax(T, U); - Assert.AreEqual(24, V.X); - Assert.AreEqual(55, V.Y); - Assert.AreEqual(1, V.Z); - } - - [Test] - public void Vector3_ComponentMaxOut() - { - Vector3 T = new Vector3(1, 55, -100); - Vector3 U = new Vector3(24, 3, 1); - Vector3 V; - Vector3.ComponentMax(ref T, ref U, out V); - Assert.AreEqual(24, V.X); - Assert.AreEqual(55, V.Y); - Assert.AreEqual(1, V.Z); - } - - [Test] - public void Vector3_Min() - { - Vector3 T = new Vector3(1, 2, 3); - Vector3 U = new Vector3(24, 300, 88); - Vector3 result = Vector3.Min(T, U); - Assert.IsTrue(result == T); - } - - [Test] - public void Vector3_Max() - { - Vector3 T = new Vector3(1, 2, 3); - Vector3 U = new Vector3(24, 300, 88); - Vector3 result = Vector3.Max(T, U); - Assert.IsTrue(result == U); - } - - [Test] - public void Vector3_Clamp() - { - Vector3 V = new Vector3(-6, 302, -22); - Vector3 min = new Vector3(-5, -10, -20); - Vector3 max = new Vector3(24, 300, 55); - Vector3 result = Vector3.Clamp(V, min, max); - Assert.AreEqual(result.X, -5); - Assert.AreEqual(result.Y, 300); - Assert.AreEqual(result.Z, -20); - } - - [Test] - public void Vector3_ClampOut() - { - Vector3 V = new Vector3(-6, 302, -22); - Vector3 min = new Vector3(-5, -10, -20); - Vector3 max = new Vector3(24, 300, 55); - Vector3 result; - Vector3.Clamp(ref V, ref min, ref max, out result); - Assert.AreEqual(result.X, -5); - Assert.AreEqual(result.Y, 300); - Assert.AreEqual(result.Z, -20); - } - - [Test] - public void Vector3_Normalize() - { - float X = 64, Y = 144, Z = 16; - Vector3 U = new Vector3(X, Y, Z); - Vector3 V = Vector3.Normalize(U); - float length = U.Length; - Assert.IsTrue(Math.Abs((U.X / length) - V.X) < 1e-5); - Assert.IsTrue(Math.Abs((U.Y / length) - V.Y) < 1e-5); - Assert.IsTrue(Math.Abs((U.Z / length) - V.Z) < 1e-5); - } - - [Test] - public void Vector3_NormalizeOut() - { - float X = 64, Y = 144, Z = 16; - Vector3 U = new Vector3(X, Y, Z); - Vector3 V; - Vector3.Normalize(ref U, out V); - float length = U.Length; - Assert.IsTrue(Math.Abs((U.X / length) - V.X) < 1e-5); - Assert.IsTrue(Math.Abs((U.Y / length) - V.Y) < 1e-5); - Assert.IsTrue(Math.Abs((U.Z / length) - V.Z) < 1e-5); - } - - [Test] - public void Vector3_NormalizeFast_Static() - { - float X = 64, Y = 144, Z = 16; - Vector3 U = new Vector3(X, Y, Z); - Vector3 V = Vector3.NormalizeFast(U); - float scale = MathHelper.InverseSqrtFast(X * X + Y * Y + Z * Z); - Assert.AreEqual(U.X * scale, V.X); - Assert.AreEqual(U.Y * scale, V.Y); - Assert.AreEqual(U.Z * scale, V.Z); - } - - [Test] - public void Vector3_NormalizeFast() - { - float X = 64, Y = 144, Z = 16; - Vector3 U = new Vector3(X, Y, Z); - Vector3 V; - Vector3.NormalizeFast(ref U, out V); - float scale = MathHelper.InverseSqrtFast(X * X + Y * Y + Z * Z); - Assert.AreEqual(U.X * scale, V.X); - Assert.AreEqual(U.Y * scale, V.Y); - Assert.AreEqual(U.Z * scale, V.Z); - } - - [Test] - public void Vector3_Dot() - { - Vector3 T = new Vector3(7, 8, 9); - Vector3 U = new Vector3(23, 89, -34); - float dot = Vector3.Dot(T, U); - float expected = T.X * U.X + T.Y * U.Y + T.Z * U.Z; - Assert.AreEqual(expected, dot); - } - - [Test] - public void Vector3_Cross() - { - Vector3 T = new Vector3(7, 8, 9); - Vector3 U = new Vector3(23, 89, -34); - Vector3 expected = new Vector3(-1073, 445, 439); - Vector3 result = Vector3.Cross(T, U); - Assert.IsTrue(expected == result); - } - - [Test] - public void Vector3_Lerp() - { - Vector3 T = new Vector3(7, 8, 9); - Vector3 U = new Vector3(23, 89, -34); - float blend = 0.25f; - Vector3 expected = blend * (U - T) + T; - Vector3 result = Vector3.Lerp(T, U, blend); - Assert.IsTrue(expected == result); - } - - [Test] - public void Vector3_LerpOut() - { - Vector3 T = new Vector3(7, 8, 9); - Vector3 U = new Vector3(23, 89, -34); - float blend = 0.25f; - Vector3 expected = blend * (U - T) + T; - Vector3 result; - Vector3.Lerp(ref T, ref U, blend, out result); - Assert.IsTrue(expected == result); - } - - [Test] - public void Vector3_BaryCentric() - { - Vector3 a = new Vector3(7, 8, 9); - Vector3 b = new Vector3(23, 89, -34); - Vector3 c = new Vector3(88, -42, 39); - float u = 0.25f; - float v = 0.75f; - Vector3 expected = a + u * (b - a) + v * (c - a); - Vector3 result = Vector3.BaryCentric(a, b, c, u, v); - Assert.IsTrue(expected == result); - } - - [Test] - public void Vector3_BaryCentricOut() - { - Vector3 a = new Vector3(7, 8, 9); - Vector3 b = new Vector3(23, 89, -34); - Vector3 c = new Vector3(88, -42, 39); - float u = 0.25f; - float v = 0.75f; - Vector3 expected = a + u * (b - a) + v * (c - a); - Vector3 result; - Vector3.BaryCentric(ref a, ref b, ref c, u, v, out result); - Assert.IsTrue(expected == result); - } - - [Test] - public void Vector3_Matrix3TimesVector3_operator() - { - Matrix3 A = new Matrix3(); - A[0, 0] = 16; A[0, 1] = 15; A[0, 2] = 14; - A[1, 0] = 12; A[1, 1] = 11; A[1, 2] = 10; - A[2, 0] = 8; A[2, 1] = 7; A[2, 2] = 6; - - Vector3 input = new Vector3(1, 5, 9); - Vector3 result = A * input; - OpenTK.Vector3 expected = new OpenTK.Vector3(217, 157, 97); - Assert.IsTrue(expected == result); - } - - [Test] - public void Vector3_Equal_operator() - { - Vector3 V = new Vector3(1, 2, 3); - Vector3 U = new Vector3(1, 2, 3); - Assert.IsTrue(U == V); - } - - - } -} diff --git a/tests/OpenTK.Tests/Vector3Tests.fs b/tests/OpenTK.Tests/Vector3Tests.fs new file mode 100644 index 00000000..18cb89a9 --- /dev/null +++ b/tests/OpenTK.Tests/Vector3Tests.fs @@ -0,0 +1,764 @@ +namespace OpenTK.Tests + +open Xunit +open FsCheck +open FsCheck.Xunit +open System +open System.Runtime.InteropServices +open OpenTK + +module Vector3 = + [ |])>] + module Constructors = + // + [] + let ``Triple value constructor sets all components to the correct values`` (a, b, c) = + let v = Vector3(a, b, c) + + Assert.Equal(a, v.X) + Assert.Equal(b, v.Y) + Assert.Equal(c, v.Z) + + [] + let ``Single value constructor sets all components to the correct values`` (a : float32) = + let v = Vector3(a) + + Assert.Equal(a, v.X) + Assert.Equal(a, v.Y) + Assert.Equal(a, v.Z) + + [] + let ``Vector2 value constructor sets all components to the correct values`` (a, b) = + let v1 = Vector2(a, b) + let v2 = Vector3(v1) + + Assert.Equal(v1.X, v2.X) + Assert.Equal(v1.Y, v2.Y) + + Assert.Equal(a, v2.X) + Assert.Equal(b, v2.Y) + Assert.Equal(0.0f, v2.Z) + + [] + let ``Vector3 value constructor sets all components to the correct values`` (a, b, c) = + let v1 = Vector3(a, b, c) + let v2 = Vector3(v1) + + Assert.Equal(v1.X, v2.X) + Assert.Equal(v1.Y, v2.Y) + Assert.Equal(v1.Z, v2.Z) + + Assert.Equal(a, v2.X) + Assert.Equal(b, v2.Y) + Assert.Equal(c, v2.Z) + + [] + let ``Vector4 value constructor sets all components to the correct values`` (a, b, c, d) = + let v1 = Vector4(a, b, c, d) + let v2 = Vector3(v1) + + Assert.Equal(v1.X, v2.X) + Assert.Equal(v1.Y, v2.Y) + Assert.Equal(v1.Z, v2.Z) + + Assert.Equal(a, v2.X) + Assert.Equal(b, v2.Y) + Assert.Equal(c, v2.Z) + + [ |])>] + module Indexing = + // + [] + let ``Index operator accesses the correct components`` (x, y, z) = + let v = Vector3(x, y, z) + + Assert.Equal(x, v.[0]) + Assert.Equal(y, v.[1]) + Assert.Equal(z, v.[2]) + + [] + let ``Indexed set operator throws exception for negative indices`` (x, y, z) = + let mutable v = Vector3(x, y, z) + + (fun() -> v.[-1] <- x) |> Assert.ThrowsIndexExn + + [] + let ``Indexed get operator throws exception for negative indices`` (x, y, z) = + let mutable v = Vector3(x, y, z) + + (fun() -> v.[-1] |> ignore) |> Assert.ThrowsIndexExn + + [] + let ``Indexed set operator throws exception for large indices`` (x, y, z) = + let mutable v = Vector3(x, y, z) + + (fun() -> v.[4] <- x) |> Assert.ThrowsIndexExn + + [] + let ``Indexed get operator throws exception for large indices`` (x, y, z) = + let mutable v = Vector3(x, y, z) + + (fun() -> v.[4] |> ignore) |> Assert.ThrowsIndexExn + + [ |])>] + module Length = + // + [] + let ``Length method follows the pythagorean theorem`` (a, b, c) = + let v = Vector3(a, b, c) + let l = System.Math.Sqrt((float)(a * a + b * b + c * c)) + + Assert.Equal((float32)l, v.Length) + + [] + let ``Fast length method is the same as one divided by the fast inverse square`` (a, b, c) = + let v = Vector3(a, b, c) + let l = 1.0f / MathHelper.InverseSqrtFast(a * a + b * b + c * c) + + Assert.Equal(l, v.LengthFast) + + [] + let ``Length squared method returns each component squared and summed`` (a, b, c) = + let v = Vector3(a, b, c) + let lsq = a * a + b * b + c * c + + Assert.Equal(lsq, v.LengthSquared) + + [ |])>] + module Distance = + [] + let ``Distance(a, b) = (b - a).Length`` (a : Vector3, b : Vector3) = + Assert.ApproximatelyEqual(Vector3.Distance(a, b), (b - a).Length) + + [] + let ``DistanceSquared(a, b) = (b - a).LengthSquared`` (a : Vector3, b : Vector3) = + Assert.ApproximatelyEqual(Vector3.DistanceSquared(a, b), (b - a).LengthSquared) + + [ |])>] + module Normalization = + // + [] + let ``Normalization creates a new unit length vector with the correct components`` (a, b, c) = + let v = Vector3(a, b, c) + let l = v.Length + + // Dividing by zero is not supported + if not (approxEq l 0.0f) then + let norm = v.Normalized() + + Assert.ApproximatelyEquivalent(v.X / l, norm.X) + Assert.ApproximatelyEquivalent(v.Y / l, norm.Y) + Assert.ApproximatelyEquivalent(v.Z / l, norm.Z) + + [] + let ``Normalization of instance transforms the instance into a unit length vector with the correct components`` (a, b, c) = + let v = Vector3(a, b, c) + let l = v.Length + + if not (approxEq l 0.0f) then + let norm = Vector3(a, b, c) + norm.Normalize() + + Assert.ApproximatelyEquivalent(v.X / l, norm.X) + Assert.ApproximatelyEquivalent(v.Y / l, norm.Y) + Assert.ApproximatelyEquivalent(v.Z / l, norm.Z) + + [] + let ``Fast approximate normalization of instance transforms the instance into a unit length vector with the correct components`` (a, b, c) = + let v = Vector3(a, b, c) + let norm = Vector3(a, b, c) + norm.NormalizeFast() + + let scale = MathHelper.InverseSqrtFast(a * a + b * b + c * c) + + Assert.ApproximatelyEquivalent(v.X * scale, norm.X) + Assert.ApproximatelyEquivalent(v.Y * scale, norm.Y) + Assert.ApproximatelyEquivalent(v.Z * scale, norm.Z) + + [] + let ``Normalization by reference is the same as division by magnitude`` (a : Vector3) = + // Zero-length vectors can't be normalized + if not (approxEq a.Length 0.0f) then + let norm = a / a.Length + let vRes = Vector3.Normalize(ref a) + + Assert.ApproximatelyEquivalent(norm, vRes) + + [] + let ``Normalization is the same as division by magnitude`` (a : Vector3) = + // Zero-length vectors can't be normalized + if not (approxEq a.Length 0.0f) then + let norm = a / a.Length + + Assert.ApproximatelyEquivalent(norm, Vector3.Normalize(a)); + + [] + let ``Fast approximate normalization by reference is the same as multiplication by the fast inverse square`` (a : Vector3) = + let scale = MathHelper.InverseSqrtFast(a.X * a.X + a.Y * a.Y + a.Z * a.Z) + + let norm = a * scale + let vRes = Vector3.NormalizeFast(ref a) + + Assert.ApproximatelyEquivalent(norm, vRes) + + [] + let ``Fast approximate normalization is the same as multiplication by fast inverse square`` (a : Vector3) = + let scale = MathHelper.InverseSqrtFast(a.X * a.X + a.Y * a.Y + a.Z * a.Z) + + let norm = a * scale + + Assert.ApproximatelyEquivalent(norm, Vector3.NormalizeFast(a)); + + [ |])>] + module Addition = + // + [] + let ``Vector3 addition is the same as component addition`` (a : Vector3, b : Vector3) = + let c = a + b + + Assert.ApproximatelyEquivalent(a.X + b.X,c.X) + Assert.ApproximatelyEquivalent(a.Y + b.Y,c.Y) + Assert.ApproximatelyEquivalent(a.Z + b.Z,c.Z) + + [] + let ``Vector3 addition is commutative`` (a : Vector3, b : Vector3) = + let c = a + b + let c2 = b + a + + Assert.ApproximatelyEquivalent(c, c2) + + [] + let ``Vector3 addition is associative`` (a : Vector3, b : Vector3, c : Vector3) = + let r1 = (a + b) + c + let r2 = a + (b + c) + + Assert.ApproximatelyEquivalent(r1, r2) + + [] + let ``Static Vector3 addition method is the same as component addition`` (a : Vector3, b : Vector3) = + + let v1 = Vector3(a.X + b.X, a.Y + b.Y, a.Z + b.Z) + let sum = Vector3.Add(a, b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [] + let ``Static Vector3 addition method by reference is the same as component addition`` (a : Vector3, b : Vector3) = + + let v1 = Vector3(a.X + b.X, a.Y + b.Y, a.Z + b.Z) + let sum = Vector3.Add(ref a, ref b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [ |])>] + module Subtraction = + // + [] + let ``Vector3 subtraction is the same as component subtraction`` (a : Vector3, b : Vector3) = + let c = a - b + + Assert.Equal(a.X - b.X,c.X) + Assert.Equal(a.Y - b.Y,c.Y) + Assert.Equal(a.Z - b.Z,c.Z) + + [] + let ``Static Vector3 subtraction method is the same as component addition`` (a : Vector3, b : Vector3) = + + let v1 = Vector3(a.X - b.X, a.Y - b.Y, a.Z - b.Z) + let sum = Vector3.Subtract(a, b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [] + let ``Static Vector3 subtraction method by reference is the same as component addition`` (a : Vector3, b : Vector3) = + + let v1 = Vector3(a.X - b.X, a.Y - b.Y, a.Z - b.Z) + let sum = Vector3.Subtract(ref a, ref b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [ |])>] + module Multiplication = + // + [] + let ``Vector3 multiplication is the same as component multiplication`` (a : Vector3, b : Vector3) = + let c = a * b + + Assert.Equal(a.X * b.X,c.X) + Assert.Equal(a.Y * b.Y,c.Y) + Assert.Equal(a.Z * b.Z,c.Z) + + [] + let ``Vector3 multiplication is commutative`` (a : Vector3, b : Vector3) = + let r1 = a * b + let r2 = b * a + + Assert.Equal(r1, r2) + + [] + let ``Left-handed Vector3-scalar multiplication is the same as component-scalar multiplication`` (a : Vector3, f : float32) = + let r = a * f + + Assert.Equal(a.X * f,r.X) + Assert.Equal(a.Y * f,r.Y) + Assert.Equal(a.Z * f,r.Z) + + [] + let ``Right-handed Vector3-scalar multiplication is the same as component-scalar multiplication`` (a : Vector3, f : float32) = + let r = f * a + Assert.Equal(a.X * f,r.X) + Assert.Equal(a.Y * f,r.Y) + Assert.Equal(a.Z * f,r.Z) + + [] + let ``Static method Vector3-scalar multiplication is the same as component-scalar multiplication`` (a : Vector3, f : float32) = + let r = Vector3.Multiply(a, f) + + Assert.Equal(a.X * f,r.X) + Assert.Equal(a.Y * f,r.Y) + Assert.Equal(a.Z * f,r.Z) + + [] + let ``Vector3-Matrix3 multiplication using right-handed notation is the same as vector/row multiplication and summation`` (a : Matrix3, b : Vector3) = + let res = a*b + + let c1 = b.X * a.M11 + b.Y * a.M12 + b.Z * a.M13 + let c2 = b.X * a.M21 + b.Y * a.M22 + b.Z * a.M23 + let c3 = b.X * a.M31 + b.Y * a.M32 + b.Z * a.M33 + + let exp = Vector3(c1, c2, c3) + + Assert.Equal(exp, res) + + [] + let ``Vector3-Matrix3 multiplication using left-handed notation is the same as vector/column multiplication and summation`` (a : Matrix3, b : Vector3) = + let res = b*a + + let c1 = b.X * a.M11 + b.Y * a.M21 + b.Z * a.M31 + let c2 = b.X * a.M12 + b.Y * a.M22 + b.Z * a.M32 + let c3 = b.X * a.M13 + b.Y * a.M23 + b.Z * a.M33 + + let exp = Vector3(c1, c2, c3) + + Assert.Equal(exp, res) + + [] + let ``Static Vector3 multiplication method is the same as component multiplication`` (a : Vector3, b : Vector3) = + + let v1 = Vector3(a.X * b.X, a.Y * b.Y, a.Z * b.Z) + let sum = Vector3.Multiply(a, b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [] + let ``Static Vector3 multiplication method by reference is the same as component multiplication`` (a : Vector3, b : Vector3) = + + let v1 = Vector3(a.X * b.X, a.Y * b.Y, a.Z * b.Z) + let sum = Vector3.Multiply(ref a, ref b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [ |])>] + module Division = + // + [] + let ``Vector3-float division is the same as component-float division`` (a : Vector3, f : float32) = + if not (approxEq f 0.0f) then // we don't support diving by zero. + let r = a / f + + Assert.ApproximatelyEquivalent(a.X / f,r.X) + Assert.ApproximatelyEquivalent(a.Y / f,r.Y) + Assert.ApproximatelyEquivalent(a.Z / f,r.Z) + + [] + let ``Static Vector3-Vector3 division method is the same as component division`` (a : Vector3, b : Vector3) = + if not (anyZero3 a || anyZero3 b) then + let v1 = Vector3(a.X / b.X, a.Y / b.Y, a.Z / b.Z) + let sum = Vector3.Divide(a, b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [] + let ``Static Vector3-Vector3 divison method by reference is the same as component division`` (a : Vector3, b : Vector3) = + if not (anyZero3 a || anyZero3 b) then + let v1 = Vector3(a.X / b.X, a.Y / b.Y, a.Z / b.Z) + let sum = Vector3.Divide(ref a, ref b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [] + let ``Static Vector3-scalar division method is the same as component division`` (a : Vector3, b : float32) = + if not (approxEq b 0.0f) then // we don't support diving by zero. + let v1 = Vector3(a.X / b, a.Y / b, a.Z / b) + let sum = Vector3.Divide(a, b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [] + let ``Static Vector3-scalar divison method by reference is the same as component division`` (a : Vector3, b : float32) = + if not (approxEq b 0.0f) then // we don't support diving by zero. + let v1 = Vector3(a.X / b, a.Y / b, a.Z / b) + let sum = Vector3.Divide(ref a, b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [ |])>] + module Negation = + // + [] + let ``Vector negation operator negates all components`` (x, y, z) = + let v = Vector3(x, y, z) + let vNeg = -v + Assert.Equal(-x, vNeg.X) + Assert.Equal(-y, vNeg.Y) + Assert.Equal(-z, vNeg.Z) + + [ |])>] + module Equality = + // + [] + let ``Vector equality operator is by component`` (x, y, z) = + let v1 = Vector3(x, y, z) + let v2 = Vector3(x, y, z) + let equality = v1 = v2 + + Assert.True(equality) + + [] + let ``Vector inequality operator is by component`` (x, y, z) = + let v1 = Vector3(x, y, z) + let v2 = Vector3(x + 1.0f , y + 1.0f, z + 1.0f) + let inequality = v1 <> v2 + + Assert.True(inequality) + + [] + let ``Vector equality method is by component`` (x, y, z) = + let v1 = Vector3(x, y, z) + let v2 = Vector3(x, y, z) + let notVector = Matrix2() + + let equality = v1.Equals(v2) + let inequalityByOtherType = v1.Equals(notVector) + + Assert.True(equality) + Assert.False(inequalityByOtherType) + + [ |])>] + module Swizzling = + // + [] + let ``Vector swizzling returns the correct composite for X-primary components`` (x, y, z) = + let v = Vector3(x, y, z) + + let xyz = Vector3(x, y, z) + let xzy = Vector3(x, z, y) + let xy = Vector2(x, y) + let xz = Vector2(x, z) + + Assert.Equal(xyz, v); + Assert.Equal(xzy, v.Xzy); + Assert.Equal(xy, v.Xy); + Assert.Equal(xz, v.Xz); + + [] + let ``Vector swizzling returns the correct composite for Y-primary components`` (x, y, z) = + let v = Vector3(x, y, z) + + let yxz = Vector3(y, x, z) + let yzx = Vector3(y, z, x) + let yx = Vector2(y, x) + let yz = Vector2(y, z) + + Assert.Equal(yxz, v.Yxz); + Assert.Equal(yzx, v.Yzx); + Assert.Equal(yx, v.Yx); + Assert.Equal(yz, v.Yz); + + [] + let ``Vector swizzling returns the correct composite for Z-primary components`` (x, y, z) = + let v = Vector3(x, y, z) + + let zxy = Vector3(z, x, y) + let zyx = Vector3(z, y, x) + let zx = Vector2(z, x) + let zy = Vector2(z, y); + + Assert.Equal(zxy, v.Zxy); + Assert.Equal(zyx, v.Zyx); + Assert.Equal(zx, v.Zx); + Assert.Equal(zy, v.Zy); + + [ |])>] + module Interpolation = + // + [] + let ``Linear interpolation is by component`` (a : Vector3, b : Vector3, q) = + + let blend = q + + let rX = blend * (b.X - a.X) + a.X + let rY = blend * (b.Y - a.Y) + a.Y + let rZ = blend * (b.Z - a.Z) + a.Z + let vExp = Vector3(rX, rY, rZ) + + Assert.Equal(vExp, Vector3.Lerp(a, b, q)) + + let vRes = Vector3.Lerp(ref a, ref b, q) + Assert.Equal(vExp, vRes) + + [] + let ``Barycentric interpolation follows the barycentric formula`` (a : Vector3, b : Vector3, c : Vector3, u, v) = + + let r = a + u * (b - a) + v * (c - a) + + Assert.Equal(r, Vector3.BaryCentric(a, b, c, u, v)) + + let vRes = Vector3.BaryCentric(ref a, ref b, ref c, u, v) + Assert.Equal(r, vRes) + + [ |])>] + module ``Vector products`` = + // + [] + let ``Dot product follows the dot product formula`` (a : Vector3, b : Vector3) = + let dot = a.X * b.X + a.Y * b.Y + a.Z * b.Z + + Assert.Equal(dot, Vector3.Dot(a, b)); + + let vRes = Vector3.Dot(ref a, ref b) + Assert.Equal(dot, vRes) + + [] + let ``Cross product follows the cross product formula`` (a : Vector3, b : Vector3) = + let crossX = a.Y * b.Z - a.Z * b.Y + let crossY = a.Z * b.X - a.X * b.Z + let crossZ = a.X * b.Y - a.Y * b.X + let cross = Vector3(crossX, crossY, crossZ) + + Assert.Equal(cross, Vector3.Cross(a, b)); + + let vRes = Vector3.Cross(ref a, ref b) + Assert.Equal(cross, vRes) + + [ |])>] + module ``Magnitude min and max`` = + // + [] + let ``MagnitudeMin selects the vector with equal or lesser magnitude given two vectors`` (v1 : Vector3, v2: Vector3) = + // Results do not matter for equal vectors + if not (v1 = v2) then + let l1 = v1.LengthSquared + let l2 = v2.LengthSquared + + let vMin = Vector3.MagnitudeMin(v1, v2) + + if vMin = v1 then + let v1ShorterThanv2 = l1 < l2 + Assert.True(v1ShorterThanv2) + else + let v2ShorterThanOrEqualTov1 = l2 <= l1 + Assert.True(v2ShorterThanOrEqualTov1) + + [] + let ``MagnitudeMax selects the vector with equal or greater magnitude given two vectors`` (v1 : Vector3, v2: Vector3) = + // Results do not matter for equal vectors + if not (v1 = v2) then + let l1 = v1.LengthSquared + let l2 = v2.LengthSquared + + let vMin = Vector3.MagnitudeMax(v1, v2) + + if vMin = v1 then + let v1LongerThanOrEqualTov2 = l1 >= l2 + Assert.True(v1LongerThanOrEqualTov2) + else + let v2LongerThanv1 = l2 > l1 + Assert.True(v2LongerThanv1) + + [] + let ``MagnitudeMin by reference selects the vector with equal or lesser magnitude given two vectors`` (v1 : Vector3, v2: Vector3) = + // Results do not matter for equal vectors + if not (v1 = v2) then + let l1 = v1.LengthSquared + let l2 = v2.LengthSquared + + let vMin = Vector3.MagnitudeMin(ref v1, ref v2) + + if vMin = v1 then + let v1ShorterThanv2 = l1 < l2 + Assert.True(v1ShorterThanv2) + else + let v2ShorterThanOrEqualTov1 = l2 <= l1 + Assert.True(v2ShorterThanOrEqualTov1) + + [] + let ``MagnitudeMax by reference selects the vector with equal or greater magnitude given two vectors`` (v1 : Vector3, v2: Vector3) = + // Results do not matter for equal vectors + if not (v1 = v2) then + let l1 = v1.LengthSquared + let l2 = v2.LengthSquared + + let vMin = Vector3.MagnitudeMax(ref v1, ref v2) + + if vMin = v1 then + let v1LongerThanOrEqualTov2 = l1 >= l2 + Assert.True(v1LongerThanOrEqualTov2) + else + let v2LongerThanv1 = l2 > l1 + Assert.True(v2LongerThanv1) + + [ |])>] + module ``Component min and max`` = + // + [] + let ``ComponentMin creates a new vector from the smallest components of given vectors`` (v1 : Vector3, v2: Vector3) = + let vMin = Vector3.ComponentMin(v1, v2) + let isComponentSmallest smallComp comp1 comp2 = smallComp <= comp1 && smallComp <= comp2 + + Assert.True(isComponentSmallest vMin.X v1.X v2.X) + Assert.True(isComponentSmallest vMin.Y v1.Y v2.Y) + Assert.True(isComponentSmallest vMin.Z v1.Z v2.Z) + + [] + let ``ComponentMax creates a new vector from the greatest components of given vectors`` (v1 : Vector3, v2: Vector3) = + let vMax = Vector3.ComponentMax(v1, v2) + let isComponentLargest largeComp comp1 comp2 = largeComp >= comp1 && largeComp >= comp2 + + Assert.True(isComponentLargest vMax.X v1.X v2.X) + Assert.True(isComponentLargest vMax.Y v1.Y v2.Y) + Assert.True(isComponentLargest vMax.Z v1.Z v2.Z) + + [] + let ``ComponentMin by reference creates a new vector from the smallest components of given vectors`` (v1 : Vector3, v2: Vector3) = + let vMin = Vector3.ComponentMin(ref v1, ref v2) + let isComponentSmallest smallComp comp1 comp2 = smallComp <= comp1 && smallComp <= comp2 + + Assert.True(isComponentSmallest vMin.X v1.X v2.X) + Assert.True(isComponentSmallest vMin.Y v1.Y v2.Y) + Assert.True(isComponentSmallest vMin.Z v1.Z v2.Z) + + [] + let ``ComponentMax by reference creates a new vector from the greatest components of given vectors`` (v1 : Vector3, v2: Vector3) = + let vMax = Vector3.ComponentMax(ref v1, ref v2) + let isComponentLargest largeComp comp1 comp2 = largeComp >= comp1 && largeComp >= comp2 + + Assert.True(isComponentLargest vMax.X v1.X v2.X) + Assert.True(isComponentLargest vMax.Y v1.Y v2.Y) + Assert.True(isComponentLargest vMax.Z v1.Z v2.Z) + + [ |])>] + module Clamping = + // + [] + let ``Clamping one vector between two other vectors clamps all components between corresponding components`` (a : Vector3, b : Vector3, w : Vector3) = + let res = Vector3.Clamp(w, a, b) + + let expX = if w.X < a.X then a.X else if w.X > b.X then b.X else w.X + let expY = if w.Y < a.Y then a.Y else if w.Y > b.Y then b.Y else w.Y + let expZ = if w.Z < a.Z then a.Z else if w.Z > b.Z then b.Z else w.Z + + Assert.Equal(expX, res.X) + Assert.Equal(expY, res.Y) + Assert.Equal(expZ, res.Z) + + [] + let ``Clamping one vector between two other vectors by reference clamps all components between corresponding components`` (a : Vector3, b : Vector3, w : Vector3) = + let res = Vector3.Clamp(ref w, ref a, ref b) + + let expX = if w.X < a.X then a.X else if w.X > b.X then b.X else w.X + let expY = if w.Y < a.Y then a.Y else if w.Y > b.Y then b.Y else w.Y + let expZ = if w.Z < a.Z then a.Z else if w.Z > b.Z then b.Z else w.Z + + Assert.Equal(expX, res.X) + Assert.Equal(expY, res.Y) + Assert.Equal(expZ, res.Z) + + [ |])>] + module ``Unit vectors``= + // + [] + let ``Unit X is correct`` = + let unitX = Vector3(1.0f, 0.0f, 0.0f) + + Assert.Equal(Vector3.UnitX, unitX) + + [] + let ``Unit Y is correct`` = + let unitY = Vector3(0.0f, 1.0f, 0.0f) + + Assert.Equal(Vector3.UnitY, unitY) + + [] + let ``Unit Z is correct`` = + let unitZ = Vector3(0.0f, 0.0f, 1.0f) + + Assert.Equal(Vector3.UnitZ, unitZ) + + [] + let ``Unit zero is correct`` = + let unitZero = Vector3(0.0f, 0.0f, 0.0f) + + Assert.Equal(Vector3.Zero, unitZero) + + [] + let ``Unit one is correct`` = + let unitOne = Vector3(1.0f, 1.0f, 1.0f) + + Assert.Equal(Vector3.One, unitOne) + + [ |])>] + module Serialization = + // + [] + let ``The absolute size of a Vector3 is always the size of its components`` (v : Vector3) = + let expectedSize = sizeof * 3 + + Assert.Equal(expectedSize, Vector3.SizeInBytes) + Assert.Equal(expectedSize, Marshal.SizeOf(Vector3())) + + [ |])>] + module Transformation = + // + [] + let ``Transformation by quaternion is the same as multiplication by quaternion and its conjugate`` (v : Vector3, q : Quaternion) = + let vectorQuat = Quaternion(v.X, v.Y, v.Z, 0.0f) + let inverse = Quaternion.Invert(q) + + let transformedQuat = q * vectorQuat * inverse + let transformedVector = transformedQuat.Xyz + + Assert.ApproximatelyEquivalent(transformedVector, Vector3.Transform(v, q)) + + [] + let ``Transformation by quaternion by reference is the same as multiplication by quaternion and its conjugate`` (v : Vector3, q : Quaternion) = + let vectorQuat = Quaternion(v.X, v.Y, v.Z, 0.0f) + let inverse = Quaternion.Invert(q) + + let transformedQuat = q * vectorQuat * inverse + let transformedVector = transformedQuat.Xyz + + Assert.ApproximatelyEquivalent(transformedVector, Vector3.Transform(ref v, ref q)) + + [] + let ``Transformation by quaternion by multiplication using right-handed notation is the same as multiplication by quaternion and its conjugate`` (v : Vector3, q : Quaternion) = + let vectorQuat = Quaternion(v.X, v.Y, v.Z, 0.0f) + let inverse = Quaternion.Invert(q) + + let transformedQuat = q * vectorQuat * inverse + let transformedVector = transformedQuat.Xyz + + Assert.ApproximatelyEquivalent(transformedVector, q * v) + + [] + let ``Transformation by identity quaternion does not alter vector`` (v : Vector3) = + let q = Quaternion.Identity + let vectorQuat = Quaternion(v.X, v.Y, v.Z, 0.0f) + let inverse = Quaternion.Invert(q) + + let transformedQuat = q * vectorQuat * inverse + let transformedVector = transformedQuat.Xyz + + Assert.ApproximatelyEquivalent(v, transformedVector) + Assert.ApproximatelyEquivalent(v, Vector3.Transform(v, q)) + Assert.ApproximatelyEquivalent(transformedVector, Vector3.Transform(v, q)) \ No newline at end of file diff --git a/tests/OpenTK.Tests/Vector4Tests.fs b/tests/OpenTK.Tests/Vector4Tests.fs new file mode 100644 index 00000000..a7fce208 --- /dev/null +++ b/tests/OpenTK.Tests/Vector4Tests.fs @@ -0,0 +1,923 @@ +namespace OpenTK.Tests + +open Xunit +open FsCheck +open FsCheck.Xunit +open System +open System.Runtime.InteropServices +open OpenTK + +module Vector4 = + [ |])>] + module Constructors = + // + [] + let ``Triple value constructor sets all components to the correct values`` (x, y, z, w) = + let v = Vector4(x, y, z, w) + + Assert.Equal(x, v.X) + Assert.Equal(y, v.Y) + Assert.Equal(z, v.Z) + Assert.Equal(w, v.W) + + [] + let ``Single value constructor sets all components to the correct values`` (a : float32) = + let v = Vector4(a) + + Assert.Equal(a, v.X) + Assert.Equal(a, v.Y) + Assert.Equal(a, v.Z) + Assert.Equal(a, v.W) + + [] + let ``Vector2 value constructor sets all components to the correct values`` (x, y) = + let v1 = Vector2(x, y) + let v2 = Vector4(v1) + + Assert.Equal(v1.X, v2.X) + Assert.Equal(v1.Y, v2.Y) + + Assert.Equal(x, v2.X) + Assert.Equal(y, v2.Y) + Assert.Equal(0.0f, v2.Z) + Assert.Equal(0.0f, v2.W) + + [] + let ``Vector3 value constructor sets all components to the correct values`` (x, y, z) = + let v1 = Vector3(x, y, z) + let v2 = Vector4(v1) + + Assert.Equal(v1.X, v2.X) + Assert.Equal(v1.Y, v2.Y) + Assert.Equal(v1.Z, v2.Z) + + Assert.Equal(x, v2.X) + Assert.Equal(y, v2.Y) + Assert.Equal(z, v2.Z) + Assert.Equal(0.0f, v2.W) + + [] + let ``Vector3 value and scalar constructor sets all components to the correct values`` (x, y, z, w) = + let v1 = Vector3(x, y, z) + let v2 = Vector4(v1, w) + + Assert.Equal(v1.X, v2.X) + Assert.Equal(v1.Y, v2.Y) + Assert.Equal(v1.Z, v2.Z) + + Assert.Equal(x, v2.X) + Assert.Equal(y, v2.Y) + Assert.Equal(z, v2.Z) + Assert.Equal(w, v2.W) + + [] + let ``Vector4 value constructor sets all components to the correct values`` (x, y, z, w) = + let v1 = Vector4(x, y, z, w) + let v2 = Vector4(v1) + + Assert.Equal(v1.X, v2.X) + Assert.Equal(v1.Y, v2.Y) + Assert.Equal(v1.Z, v2.Z) + Assert.Equal(v1.W, v2.W) + + Assert.Equal(x, v2.X) + Assert.Equal(y, v2.Y) + Assert.Equal(z, v2.Z) + Assert.Equal(w, v2.W) + + [ |])>] + module Indexing = + // + [] + let ``Index operator accesses the correct components`` (x, y, z, w) = + let v = Vector4(x, y, z, w) + + Assert.Equal(x, v.[0]) + Assert.Equal(y, v.[1]) + Assert.Equal(z, v.[2]) + Assert.Equal(w, v.[3]) + + [] + let ``Indexed set operator throws exception for negative indices`` (x, y, z, w) = + let mutable v = Vector4(x, y, z, w) + + (fun() -> v.[-1] <- x) |> Assert.ThrowsIndexExn + + [] + let ``Indexed get operator throws exception for negative indices`` (x, y, z, w) = + let mutable v = Vector4(x, y, z, w) + + (fun() -> v.[-1] |> ignore) |> Assert.ThrowsIndexExn + + [] + let ``Indexed set operator throws exception for large indices`` (x, y, z, w) = + let mutable v = Vector4(x, y, z, w) + + (fun() -> v.[4] <- x) |> Assert.ThrowsIndexExn + + [] + let ``Indexed get operator throws exception for large indices`` (x, y, z, w) = + let mutable v = Vector4(x, y, z, w) + + (fun() -> v.[4] |> ignore) |> Assert.ThrowsIndexExn + + [ |])>] + module Length = + // + [] + let ``Length method follows the pythagorean theorem`` (x, y, z, w) = + let v = Vector4(x, y, z, w) + let l = System.Math.Sqrt((float)(x * x + y * y + z * z + w * w)) + + Assert.Equal((float32)l, v.Length) + + [] + let ``Fast length method is the same as one divided by the fast inverse square`` (x, y, z, w) = + let v = Vector4(x, y, z, w) + let l = 1.0f / MathHelper.InverseSqrtFast(x * x + y * y + z * z + w * w) + + Assert.Equal(l, v.LengthFast) + + [] + let ``Length squared method returns each component squared and summed`` (x, y, z, w) = + let v = Vector4(x, y, z, w) + let lsq = x * x + y * y + z * z + w * w + + Assert.Equal(lsq, v.LengthSquared) + + [ |])>] + module Normalization = + // + [] + let ``Normalization creates a new unit length vector with the correct components`` (x, y, z, w) = + let v = Vector4(x, y, z, w) + let l = v.Length + + // Zero-length vectors can't be normalized + if not (approxEq l 0.0f) then + let norm = v.Normalized() + + Assert.ApproximatelyEquivalent(v.X / l, norm.X) + Assert.ApproximatelyEquivalent(v.Y / l, norm.Y) + Assert.ApproximatelyEquivalent(v.Z / l, norm.Z) + Assert.ApproximatelyEquivalent(v.W / l, norm.W) + + [] + let ``Normalization of instance transforms the instance into a unit length vector with the correct components`` (x, y, z, w) = + let v = Vector4(x, y, z, w) + let l = v.Length + + // Zero-length vectors can't be normalized + if not (approxEq l 0.0f) then + let norm = Vector4(x, y, z, w) + norm.Normalize() + + Assert.ApproximatelyEquivalent(v.X / l, norm.X) + Assert.ApproximatelyEquivalent(v.Y / l, norm.Y) + Assert.ApproximatelyEquivalent(v.Z / l, norm.Z) + Assert.ApproximatelyEquivalent(v.W / l, norm.W) + + [] + let ``Fast approximate normalization of instance transforms the instance into a unit length vector with the correct components`` (x, y, z, w) = + let v = Vector4(x, y, z, w) + let norm = Vector4(x, y, z, w) + norm.NormalizeFast() + + let scale = MathHelper.InverseSqrtFast(x * x + y * y + z * z + w * w) + + Assert.ApproximatelyEquivalent(v.X * scale, norm.X) + Assert.ApproximatelyEquivalent(v.Y * scale, norm.Y) + Assert.ApproximatelyEquivalent(v.Z * scale, norm.Z) + Assert.ApproximatelyEquivalent(v.W * scale, norm.W) + + [] + let ``Normalization by reference is the same as division by magnitude`` (a : Vector4) = + // Zero-length vectors can't be normalized + if not (approxEq a.Length 0.0f) then + let norm = a / a.Length + let vRes = Vector4.Normalize(ref a) + + Assert.ApproximatelyEquivalent(norm, vRes) + + [] + let ``Normalization is the same as division by magnitude`` (a : Vector4) = + // Zero-length vectors can't be normalized + if not (approxEq a.Length 0.0f) then + let norm = a / a.Length + + Assert.ApproximatelyEquivalent(norm, Vector4.Normalize(a)); + + [] + let ``Fast approximate normalization by reference is the same as multiplication by the fast inverse square`` (a : Vector4) = + let scale = MathHelper.InverseSqrtFast(a.X * a.X + a.Y * a.Y + a.Z * a.Z + a.W * a.W) + + let norm = a * scale + let vRes = Vector4.NormalizeFast(ref a) + + Assert.ApproximatelyEquivalent(norm, vRes) + + [] + let ``Fast approximate normalization is the same as multiplication by the fast inverse square`` (a : Vector4) = + let scale = MathHelper.InverseSqrtFast(a.X * a.X + a.Y * a.Y + a.Z * a.Z + a.W * a.W) + let norm = a * scale + + Assert.ApproximatelyEquivalent(norm, Vector4.NormalizeFast(a)); + + [ |])>] + module Addition = + // + [] + let ``Vector4 addition is the same as component addition`` (a : Vector4, b : Vector4) = + let c = a + b + + Assert.ApproximatelyEquivalent(a.X + b.X,c.X) + Assert.ApproximatelyEquivalent(a.Y + b.Y,c.Y) + Assert.ApproximatelyEquivalent(a.Z + b.Z,c.Z) + Assert.ApproximatelyEquivalent(a.W + b.W,c.W) + + [] + let ``Vector4 addition is commutative`` (a : Vector4, b : Vector4) = + let c = a + b + let c2 = b + a + + Assert.ApproximatelyEquivalent(c, c2) + + [] + let ``Vector4 addition is associative`` (a : Vector4, b : Vector4, c : Vector4) = + let r1 = (a + b) + c + let r2 = a + (b + c) + + Assert.ApproximatelyEquivalent(r1, r2) + + [] + let ``Static Vector4 addition method is the same as component addition`` (a : Vector4, b : Vector4) = + + let v1 = Vector4(a.X + b.X, a.Y + b.Y, a.Z + b.Z, a.W + b.W) + let sum = Vector4.Add(a, b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [] + let ``Static Vector4 addition method by reference is the same as component addition`` (a : Vector4, b : Vector4) = + + let v1 = Vector4(a.X + b.X, a.Y + b.Y, a.Z + b.Z, a.W + b.W) + let sum = Vector4.Add(ref a, ref b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [ |])>] + module Subtraction = + // + [] + let ``Vector4 subtraction is the same as component subtraction`` (a : Vector4, b : Vector4) = + let c = a - b + + Assert.Equal(a.X - b.X,c.X) + Assert.Equal(a.Y - b.Y,c.Y) + Assert.Equal(a.Z - b.Z,c.Z) + Assert.Equal(a.W - b.W,c.W) + + [] + let ``Static Vector4 subtraction method is the same as component addition`` (a : Vector4, b : Vector4) = + + let v1 = Vector4(a.X - b.X, a.Y - b.Y, a.Z - b.Z, a.W - b.W) + let sum = Vector4.Subtract(a, b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [] + let ``Static Vector4 subtraction method by reference is the same as component addition`` (a : Vector4, b : Vector4) = + + let v1 = Vector4(a.X - b.X, a.Y - b.Y, a.Z - b.Z, a.W - b.W) + let sum = Vector4.Subtract(ref a, ref b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [ |])>] + module Multiplication = + // + [] + let ``Vector4 multiplication is the same as component multiplication`` (a : Vector4, b : Vector4) = + let c = a * b + + Assert.Equal(a.X * b.X,c.X) + Assert.Equal(a.Y * b.Y,c.Y) + Assert.Equal(a.Z * b.Z,c.Z) + Assert.Equal(a.W * b.W,c.W) + + + [] + let ``Vector4 multiplication is commutative`` (a : Vector4, b : Vector4) = + let r1 = a * b + let r2 = b * a + + Assert.Equal(r1, r2) + + [] + let ``Left-handed Vector4-scalar multiplication is the same as component-scalar multiplication`` (a : Vector4, f : float32) = + let r = a * f + + Assert.Equal(a.X * f,r.X) + Assert.Equal(a.Y * f,r.Y) + Assert.Equal(a.Z * f,r.Z) + Assert.Equal(a.W * f,r.W) + + [] + let ``Right-handed Vector4-scalar multiplication is the same as component-scalar multiplication`` (a : Vector4, f : float32) = + let r = f * a + Assert.Equal(a.X * f,r.X) + Assert.Equal(a.Y * f,r.Y) + Assert.Equal(a.Z * f,r.Z) + Assert.Equal(a.W * f,r.W) + + [] + let ``Static method Vector4-scalar multiplication is the same as component-scalar multiplication`` (a : Vector4, f : float32) = + let r = Vector4.Multiply(a, f) + + Assert.Equal(a.X * f,r.X) + Assert.Equal(a.Y * f,r.Y) + Assert.Equal(a.Z * f,r.Z) + Assert.Equal(a.W * f,r.W) + + [] + let ``Vector4-Matrix4 multiplication using right-handed notation is the same as vector/row multiplication and summation`` (a : Matrix4, b : Vector4) = + let res = a*b + + let c1 = b.X * a.M11 + b.Y * a.M12 + b.Z * a.M13 + b.W * a.M14 + let c2 = b.X * a.M21 + b.Y * a.M22 + b.Z * a.M23 + b.W * a.M24 + let c3 = b.X * a.M31 + b.Y * a.M32 + b.Z * a.M33 + b.W * a.M34 + let c4 = b.X * a.M41 + b.Y * a.M42 + b.Z * a.M43 + b.W * a.M44 + + let exp = Vector4(c1, c2, c3, c4) + + Assert.Equal(exp, res) + + [] + let ``Vector4-Matrix4 multiplication using left-handed notation is the same as vector/column multiplication and summation`` (a : Matrix4, b : Vector4) = + let res = b*a + + let c1 = b.X * a.M11 + b.Y * a.M21 + b.Z * a.M31 + b.W * a.M41 + let c2 = b.X * a.M12 + b.Y * a.M22 + b.Z * a.M32 + b.W * a.M42 + let c3 = b.X * a.M13 + b.Y * a.M23 + b.Z * a.M33 + b.W * a.M43 + let c4 = b.X * a.M14 + b.Y * a.M24 + b.Z * a.M34 + b.W * a.M44 + + let exp = Vector4(c1, c2, c3, c4) + + Assert.Equal(exp, res) + + [] + let ``Static Vector4 multiplication method is the same as component multiplication`` (a : Vector4, b : Vector4) = + + let v1 = Vector4(a.X * b.X, a.Y * b.Y, a.Z * b.Z, a.W * b.W) + let sum = Vector4.Multiply(a, b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [] + let ``Static Vector4 multiplication method by reference is the same as component multiplication`` (a : Vector4, b : Vector4) = + + let v1 = Vector4(a.X * b.X, a.Y * b.Y, a.Z * b.Z, a.W * b.W) + let sum = Vector4.Multiply(ref a, ref b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [ |])>] + module Division = + // + [] + let ``Vector4-float division is the same as component-float division`` (a : Vector4, f : float32) = + if not (approxEq f 0.0f) then // we don't support diving by zero. + let r = a / f + + Assert.ApproximatelyEquivalent(a.X / f, r.X) + Assert.ApproximatelyEquivalent(a.Y / f, r.Y) + Assert.ApproximatelyEquivalent(a.Z / f, r.Z) + Assert.ApproximatelyEquivalent(a.W / f, r.W) + + [] + let ``Static Vector4-Vector4 division method is the same as component division`` (a : Vector4, b : Vector4) = + if not (anyZero4 a || anyZero4 b) then + let v1 = Vector4(a.X / b.X, a.Y / b.Y, a.Z / b.Z, a.W / b.W) + let sum = Vector4.Divide(a, b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [] + let ``Static Vector4-Vector4 divison method by reference is the same as component division`` (a : Vector4, b : Vector4) = + if not (anyZero4 a || anyZero4 b) then + let v1 = Vector4(a.X / b.X, a.Y / b.Y, a.Z / b.Z, a.W / b.W) + let sum = Vector4.Divide(ref a, ref b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [] + let ``Static Vector4-scalar division method is the same as component division`` (a : Vector4, b : float32) = + if not (approxEq b 0.0f) then // we don't support diving by zero. + let v1 = Vector4(a.X / b, a.Y / b, a.Z / b, a.W / b) + let sum = Vector4.Divide(a, b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [] + let ``Static Vector4-scalar divison method by reference is the same as component division`` (a : Vector4, b : float32) = + if not (approxEq b 0.0f) then // we don't support diving by zero. + let v1 = Vector4(a.X / b, a.Y / b, a.Z / b, a.W / b) + let sum = Vector4.Divide(ref a, b) + + Assert.ApproximatelyEquivalent(v1, sum) + + [ |])>] + module Negation = + // + [] + let ``Vector negation operator negates all components`` (x, y, z, w) = + let v = Vector4(x, y, z, w) + let vNeg = -v + Assert.Equal(-x, vNeg.X) + Assert.Equal(-y, vNeg.Y) + Assert.Equal(-z, vNeg.Z) + Assert.Equal(-w, vNeg.W) + + [ |])>] + module Equality = + // + [] + let ``Vector equality operator is by component`` (x, y, z, w) = + let v1 = Vector4(x, y, z, w) + let v2 = Vector4(x, y, z, w) + let equality = v1 = v2 + + Assert.True(equality) + + [] + let ``Vector inequality operator is by component`` (x, y, z, w) = + let v1 = Vector4(x, y, z, w) + let v2 = Vector4(x + 1.0f , y + 1.0f, z + 1.0f, w + 1.0f) + let inequality = v1 <> v2 + + Assert.True(inequality) + + [] + let ``Vector equality method is by component`` (x, y, z, w) = + let v1 = Vector4(x, y, z, w) + let v2 = Vector4(x, y, z, w) + let notVector = Matrix2() + + let equality = v1.Equals(v2) + let inequalityByOtherType = v1.Equals(notVector) + + Assert.True(equality) + Assert.False(inequalityByOtherType) + + [] + let ``Vector equality method returns false for other classes`` (x, y, z, w) = + let v1 = Vector4(x, y, z, w) + let notVector = Matrix2() + + let inequalityByOtherType = v1.Equals(notVector) + + Assert.False(inequalityByOtherType) + + [ |])>] + module Swizzling = + // + [] + let ``Vector swizzling returns the correct composite for X-primary components`` (x, y, z, w) = + + let v = Vector4(x, y, z, w) + + let xyzw = v + let xywz = Vector4(x, y, w, z) + let xzyw = Vector4(x, z, y, w) + let xzwy = Vector4(x, z, w, y) + let xwyz = Vector4(x, w, y, z) + let xwzy = Vector4(x, w, z, y) + + let xyz = Vector3(x, y, z) + let xyw = Vector3(x, y, w) + let xzy = Vector3(x, z, y) + let xzw = Vector3(x, z, w) + let xwy = Vector3(x, w, y) + let xwz = Vector3(x, w, z) + + let xy = Vector2(x, y) + let xz = Vector2(x, z) + let xw = Vector2(x, w) + + // X primary + Assert.Equal(xyzw, v) + Assert.Equal(xywz, v.Xywz) + Assert.Equal(xzyw, v.Xzyw) + Assert.Equal(xzwy, v.Xzwy) + Assert.Equal(xwyz, v.Xwyz) + Assert.Equal(xwzy, v.Xwzy) + + Assert.Equal(xyz, v.Xyz) + Assert.Equal(xyw, v.Xyw) + Assert.Equal(xzy, v.Xzy) + Assert.Equal(xzw, v.Xzw) + Assert.Equal(xwy, v.Xwy) + Assert.Equal(xwz, v.Xwz) + + Assert.Equal(xy, v.Xy) + Assert.Equal(xz, v.Xz) + Assert.Equal(xw, v.Xw) + + [] + let ``Vector swizzling returns the correct composite for Y-primary components`` (x, y, z, w) = + + let v = Vector4(x, y, z, w) + + let yxzw = Vector4(y, x, z, w) + let yxwz = Vector4(y, x, w, z) + let yyzw = Vector4(y, y, z, w) + let yywz = Vector4(y, y, w, z) + let yzxw = Vector4(y, z, x, w) + let yzwx = Vector4(y, z, w, x) + let ywxz = Vector4(y, w, x, z) + let ywzx = Vector4(y, w, z, x) + + let yxz = Vector3(y, x, z) + let yxw = Vector3(y, x, w) + let yzx = Vector3(y, z, x) + let yzw = Vector3(y, z, w) + let ywx = Vector3(y, w, x) + let ywz = Vector3(y, w, z) + + let yx = Vector2(y, x) + let yz = Vector2(y, z) + let yw = Vector2(y, w) + + // Y primary + Assert.Equal(yxzw, v.Yxzw) + Assert.Equal(yxwz, v.Yxwz) + Assert.Equal(yyzw, v.Yyzw) + Assert.Equal(yywz, v.Yywz) + Assert.Equal(yzxw, v.Yzxw) + Assert.Equal(yzwx, v.Yzwx) + Assert.Equal(ywxz, v.Ywxz) + Assert.Equal(ywzx, v.Ywzx) + + Assert.Equal(yxz, v.Yxz) + Assert.Equal(yxw, v.Yxw) + Assert.Equal(yzx, v.Yzx) + Assert.Equal(yzw, v.Yzw) + Assert.Equal(ywx, v.Ywx) + Assert.Equal(ywz, v.Ywz) + + Assert.Equal(yx, v.Yx) + Assert.Equal(yz, v.Yz) + Assert.Equal(yw, v.Yw) + + [] + let ``Vector swizzling returns the correct composite for Z-primary components`` (x, y, z, w) = + + let v = Vector4(x, y, z, w) + + let zxyw = Vector4(z, x, y, w) + let zxwy = Vector4(z, x, w, y) + let zyxw = Vector4(z, y, x, w) + let zywx = Vector4(z, y, w, x) + let zwxy = Vector4(z, w, x, y) + let zwyx = Vector4(z, w, y, x) + let zwzy = Vector4(z, w, z, y) + + let zxy = Vector3(z, x, y) + let zxw = Vector3(z, x, w) + let zyx = Vector3(z, y, x) + let zyw = Vector3(z, y, w) + let zwx = Vector3(z, w, x) + let zwy = Vector3(z, w, y) + + let zx = Vector2(z, x) + let zy = Vector2(z, y) + let zw = Vector2(z, w) + + // Z primary + Assert.Equal(zxyw, v.Zxyw) + Assert.Equal(zxwy, v.Zxwy) + Assert.Equal(zyxw, v.Zyxw) + Assert.Equal(zywx, v.Zywx) + Assert.Equal(zwxy, v.Zwxy) + Assert.Equal(zwyx, v.Zwyx) + Assert.Equal(zwzy, v.Zwzy) + + Assert.Equal(zxy, v.Zxy) + Assert.Equal(zxw, v.Zxw) + Assert.Equal(zyx, v.Zyx) + Assert.Equal(zyw, v.Zyw) + Assert.Equal(zwx, v.Zwx) + Assert.Equal(zwy, v.Zwy) + + Assert.Equal(zx, v.Zx) + Assert.Equal(zy, v.Zy) + Assert.Equal(zw, v.Zw) + + [] + let ``Vector swizzling returns the correct composite for W-primary components`` (x, y, z, w) = + + let v = Vector4(x, y, z, w) + + let wxyz = Vector4(w, x, y, z) + let wxzy = Vector4(w, x, z, y) + let wyxz = Vector4(w, y, x, z) + let wyzx = Vector4(w, y, z, x) + let wzxy = Vector4(w, z, x, y) + let wzyx = Vector4(w, z, y, x) + let wzyw = Vector4(w, z, y, w) + + let wxy = Vector3(w, x, y) + let wxz = Vector3(w, x, z) + let wyx = Vector3(w, y, x) + let wyz = Vector3(w, y, z) + let wzx = Vector3(w, z, x) + let wzy = Vector3(w, z, y) + + let wx = Vector2(w, x) + let wy = Vector2(w, y) + let wz = Vector2(w, z) + + // W primary + Assert.Equal(wxyz, v.Wxyz) + Assert.Equal(wxzy, v.Wxzy) + Assert.Equal(wyxz, v.Wyxz) + Assert.Equal(wyzx, v.Wyzx) + Assert.Equal(wzxy, v.Wzxy) + Assert.Equal(wzyx, v.Wzyx) + Assert.Equal(wzyw, v.Wzyw) + + Assert.Equal(wxy, v.Wxy) + Assert.Equal(wxz, v.Wxz) + Assert.Equal(wyx, v.Wyx) + Assert.Equal(wyz, v.Wyz) + Assert.Equal(wzx, v.Wzx) + Assert.Equal(wzy, v.Wzy) + + Assert.Equal(wx, v.Wx) + Assert.Equal(wy, v.Wy) + Assert.Equal(wz, v.Wz) + + [ |])>] + module Interpolation = + // + [] + let ``Linear interpolation is by component`` (a : Vector4, b : Vector4, q) = + + let blend = q + + let rX = blend * (b.X - a.X) + a.X + let rY = blend * (b.Y - a.Y) + a.Y + let rZ = blend * (b.Z - a.Z) + a.Z + let rW = blend * (b.W - a.W) + a.W + let vExp = Vector4(rX, rY, rZ, rW) + + Assert.Equal(vExp, Vector4.Lerp(a, b, q)) + + let vRes = Vector4.Lerp(ref a, ref b, q) + Assert.Equal(vExp, vRes) + + [] + let ``Barycentric interpolation follows the barycentric formula`` (a : Vector4, b : Vector4, c : Vector4, u, v) = + + let r = a + u * (b - a) + v * (c - a) + + Assert.Equal(r, Vector4.BaryCentric(a, b, c, u, v)) + + let vRes = Vector4.BaryCentric(ref a, ref b, ref c, u, v) + Assert.Equal(r, vRes) + + [ |])>] + module ``Vector products`` = + // + [] + let ``Dot product method follows the dot product formula`` (a : Vector4, b : Vector4) = + let dot = a.X * b.X + a.Y * b.Y + a.Z * b.Z + a.W * b.W + + Assert.Equal(dot, Vector4.Dot(a, b)); + + let vRes = Vector4.Dot(ref a, ref b) + Assert.Equal(dot, vRes) + + [ |])>] + module ``Magnitude min and max`` = + // + [] + let ``MagnitudeMin selects the vector with equal or lesser magnitude given two vectors`` (v1 : Vector4, v2: Vector4) = + // Results do not matter for equal vectors + if not (v1 = v2) then + let l1 = v1.LengthSquared + let l2 = v2.LengthSquared + + let vMin = Vector4.MagnitudeMin(v1, v2) + + if vMin = v1 then + let v1ShorterThanv2 = l1 < l2 + Assert.True(v1ShorterThanv2) + else + let v2ShorterThanOrEqualTov1 = l2 <= l1 + Assert.True(v2ShorterThanOrEqualTov1) + + [] + let ``MagnitudeMax selects the vector with equal or greater magnitude given two vectors`` (v1 : Vector4, v2: Vector4) = + // Results do not matter for equal vectors + if not (v1 = v2) then + let l1 = v1.LengthSquared + let l2 = v2.LengthSquared + + let vMin = Vector4.MagnitudeMax(v1, v2) + + if vMin = v1 then + let v1LongerThanOrEqualTov2 = l1 >= l2 + Assert.True(v1LongerThanOrEqualTov2) + else + let v2LongerThanv1 = l2 > l1 + Assert.True(v2LongerThanv1) + + [] + let ``MagnitudeMin by reference selects the vector with equal or lesser magnitude given two vectors`` (v1 : Vector4, v2: Vector4) = + // Results do not matter for equal vectors + if not (v1 = v2) then + let l1 = v1.LengthSquared + let l2 = v2.LengthSquared + + let vMin = Vector4.MagnitudeMin(ref v1, ref v2) + + if vMin = v1 then + let v1ShorterThanv2 = l1 < l2 + Assert.True(v1ShorterThanv2) + else + let v2ShorterThanOrEqualTov1 = l2 <= l1 + Assert.True(v2ShorterThanOrEqualTov1) + + [] + let ``MagnitudeMax by reference selects the vector with equal or greater magnitude given two vectors`` (v1 : Vector4, v2: Vector4) = + // Results do not matter for equal vectors + if not (v1 = v2) then + let l1 = v1.LengthSquared + let l2 = v2.LengthSquared + + let vMin = Vector4.MagnitudeMax(ref v1, ref v2) + + if vMin = v1 then + let v1LongerThanOrEqualTov2 = l1 >= l2 + Assert.True(v1LongerThanOrEqualTov2) + else + let v2LongerThanv1 = l2 > l1 + Assert.True(v2LongerThanv1) + + [ |])>] + module ``Component min and max`` = + // + [] + let ``ComponentMin creates a new vector from the smallest components of given vectors`` (v1 : Vector4, v2: Vector4) = + let vMin = Vector4.ComponentMin(v1, v2) + let isComponentSmallest smallComp comp1 comp2 = smallComp <= comp1 && smallComp <= comp2 + + Assert.True(isComponentSmallest vMin.X v1.X v2.X) + Assert.True(isComponentSmallest vMin.Y v1.Y v2.Y) + Assert.True(isComponentSmallest vMin.Z v1.Z v2.Z) + Assert.True(isComponentSmallest vMin.W v1.W v2.W) + + [] + let ``ComponentMax creates a new vector from the greatest components of given vectors`` (v1 : Vector4, v2: Vector4) = + let vMax = Vector4.ComponentMax(v1, v2) + let isComponentLargest largeComp comp1 comp2 = largeComp >= comp1 && largeComp >= comp2 + + Assert.True(isComponentLargest vMax.X v1.X v2.X) + Assert.True(isComponentLargest vMax.Y v1.Y v2.Y) + Assert.True(isComponentLargest vMax.Z v1.Z v2.Z) + Assert.True(isComponentLargest vMax.W v1.W v2.W) + + [] + let ``ComponentMin by reference creates a new vector from the smallest components of given vectors`` (v1 : Vector4, v2: Vector4) = + let vMin = Vector4.ComponentMin(ref v1, ref v2) + let isComponentSmallest smallComp comp1 comp2 = smallComp <= comp1 && smallComp <= comp2 + + Assert.True(isComponentSmallest vMin.X v1.X v2.X) + Assert.True(isComponentSmallest vMin.Y v1.Y v2.Y) + Assert.True(isComponentSmallest vMin.Z v1.Z v2.Z) + Assert.True(isComponentSmallest vMin.W v1.W v2.W) + + [] + let ``ComponentMax by reference creates a new vector from the greatest components of given vectors`` (v1 : Vector4, v2: Vector4) = + let vMax = Vector4.ComponentMax(ref v1, ref v2) + let isComponentLargest largeComp comp1 comp2 = largeComp >= comp1 && largeComp >= comp2 + + Assert.True(isComponentLargest vMax.X v1.X v2.X) + Assert.True(isComponentLargest vMax.Y v1.Y v2.Y) + Assert.True(isComponentLargest vMax.Z v1.Z v2.Z) + Assert.True(isComponentLargest vMax.W v1.W v2.W) + + + [ |])>] + module Clamping = + // + [] + let ``Clamping one vector between two other vectors clamps all components between corresponding components`` (a : Vector4, b : Vector4, w : Vector4) = + let expX = if w.X < a.X then a.X else if w.X > b.X then b.X else w.X + let expY = if w.Y < a.Y then a.Y else if w.Y > b.Y then b.Y else w.Y + let expZ = if w.Z < a.Z then a.Z else if w.Z > b.Z then b.Z else w.Z + let expW = if w.W < a.W then a.W else if w.W > b.W then b.W else w.W + + let res = Vector4.Clamp(w, a, b) + + Assert.Equal(expX, res.X) + Assert.Equal(expY, res.Y) + Assert.Equal(expZ, res.Z) + Assert.Equal(expW, res.W) + + [] + let ``Clamping one vector between two other vectors by reference clamps all components between corresponding components`` (a : Vector4, b : Vector4, w : Vector4) = + let expX = if w.X < a.X then a.X else if w.X > b.X then b.X else w.X + let expY = if w.Y < a.Y then a.Y else if w.Y > b.Y then b.Y else w.Y + let expZ = if w.Z < a.Z then a.Z else if w.Z > b.Z then b.Z else w.Z + let expW = if w.W < a.W then a.W else if w.W > b.W then b.W else w.W + + let res = Vector4.Clamp(ref w, ref a, ref b) + + Assert.Equal(expX, res.X) + Assert.Equal(expY, res.Y) + Assert.Equal(expZ, res.Z) + Assert.Equal(expW, res.W) + + [ |])>] + module ``Unit vectors``= + // + [] + let ``Unit X is correct`` = + let unitX = Vector4(1.0f, 0.0f, 0.0f, 0.0f) + + Assert.Equal(Vector4.UnitX, unitX) + + [] + let ``Unit Y is correct`` = + let unitY = Vector4(0.0f, 1.0f, 0.0f, 0.0f) + + Assert.Equal(Vector4.UnitY, unitY) + + [] + let ``Unit Z is correct`` = + let unitZ = Vector4(0.0f, 0.0f, 1.0f, 0.0f) + + Assert.Equal(Vector4.UnitZ, unitZ) + + [] + let ``Unit W is correct`` = + let unitW = Vector4(0.0f, 0.0f, 0.0f, 1.0f) + + Assert.Equal(Vector4.UnitW, unitW) + + [] + let ``Unit zero is correct`` = + let unitZero = Vector4(0.0f, 0.0f, 0.0f, 0.0f) + + Assert.Equal(Vector4.Zero, unitZero) + + [] + let ``Unit one is correct`` = + let unitOne = Vector4(1.0f, 1.0f, 1.0f, 1.0f) + + Assert.Equal(Vector4.One, unitOne) + + [ |])>] + module Serialization = + // + [] + let ``The absolute size of a Vector4 is always the size of its components`` (v : Vector4) = + let expectedSize = sizeof * 4 + + Assert.Equal(expectedSize, Vector4.SizeInBytes) + Assert.Equal(expectedSize, Marshal.SizeOf(Vector4())) + + [ |])>] + module Transformation = + // + [] + let ``Transformation by quaternion with static method is the same as multiplication by quaternion and its conjugate`` (v : Vector4, q : Quaternion) = + let vectorQuat = Quaternion(v.X, v.Y, v.Z, v.W) + let inverse = Quaternion.Invert(q) + + let transformedQuat = q * vectorQuat * inverse + let transformedVector = Vector4(transformedQuat.X, transformedQuat.Y, transformedQuat.Z, transformedQuat.W) + + Assert.ApproximatelyEquivalent(transformedVector, Vector4.Transform(v, q)) + + [] + let ``Transformation by quaternion with static method by reference is the same as multiplication by quaternion and its conjugate`` (v : Vector4, q : Quaternion) = + let vectorQuat = Quaternion(v.X, v.Y, v.Z, v.W) + let inverse = Quaternion.Invert(q) + + let transformedQuat = q * vectorQuat * inverse + let transformedVector = Vector4(transformedQuat.X, transformedQuat.Y,transformedQuat.Z, transformedQuat.W) + + Assert.ApproximatelyEquivalent(transformedVector, Vector4.Transform(ref v, ref q)) + + [] + let ``Transformation by quaternion by multiplication using right-handed notation is the same as multiplication by quaternion and its conjugate`` (v : Vector4, q : Quaternion) = + let vectorQuat = Quaternion(v.X, v.Y, v.Z, v.W) + let inverse = Quaternion.Invert(q) + + let transformedQuat = q * vectorQuat * inverse + let transformedVector = Vector4(transformedQuat.X, transformedQuat.Y, transformedQuat.Z, transformedQuat.W) + + Assert.ApproximatelyEquivalent(transformedVector, q * v) \ No newline at end of file diff --git a/tests/OpenTK.Tests/packages.config b/tests/OpenTK.Tests/packages.config deleted file mode 100644 index 1f8800b2..00000000 --- a/tests/OpenTK.Tests/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/tests/OpenTK.Tests/paket.references b/tests/OpenTK.Tests/paket.references new file mode 100644 index 00000000..ecbc089e --- /dev/null +++ b/tests/OpenTK.Tests/paket.references @@ -0,0 +1,2 @@ +FsCheck.Xunit +xunit.assert