Skip to content

Instantly share code, notes, and snippets.

@solvingj
solvingj / derived
Created September 17, 2018 03:26
derived class
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from conans import python_requires
base = python_requires("boost_base/1.67.0@bincrafters/testing")
class BoostLocaleConan(base.BoostBaseConan):
name = "boost_locale"
@solvingj
solvingj / base
Last active September 19, 2018 13:00
base class
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from conans import ConanFile, tools
import os
class BoostBaseConan(ConanFile):
name = "boost_base"
version = "1.67.0"
#include "stdafx.h"
#include "CppUnitTest.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
extern "C" {
#include "ArrayList.h"
}
#include <stdarg.h>
>------ Build started: Project: CMakeLists, Configuration: Release ------
Microsoft (R) Build Engine version 15.6.82.30579 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
vscommon.vcxproj -> C:\Users\jwiltse\CMakeBuilds\95bd164a-113a-053c-b2bb-0557f464c156\build\x86-Release\source\Release\vscommon.lib
Auto build dll exports
Creating library C:/Users/jwiltse/CMakeBuilds/95bd164a-113a-053c-b2bb-0557f464c156/build/x86-Release/test/Release/tests_shared.lib and object C:/Users/jwiltse/CMakeBuilds/95bd164a-113a-053c-b2bb-0557f464c156/build/x86-Release/test/Release/tests_shared.exp
tests_shared.vcxproj -> C:\Users\jwiltse\CMakeBuilds\95bd164a-113a-053c-b2bb-0557f464c156\build\x86-Release\test\Release\tests_shared.dll
Auto build dll exports
Creating library C:/Users/jwiltse/CMakeBuilds/95bd164a-113a-053c-b2bb-0557f464c156/build/x86-Release/test/Release/ArrayList_Test.lib and object C:/Users/jwiltse/CMakeBuilds/95bd164a-113a-053c-b2bb-0557f464c156/build
build: false
environment:
PYTHON: "C:\\Python27"
PYTHON_VERSION: "2.7.8"
PYTHON_ARCH: "32"
CYGWIN_ROOT: "C:\\cygwin64"
MSYS_ROOT: "C:\\msys64"
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Win7 OEM Release(WinPcap Mode)|Win32">
<Configuration>Win7 OEM Release(WinPcap Mode)</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win7 OEM Release(WinPcap Mode)|x64">
<Configuration>Win7 OEM Release(WinPcap Mode)</Configuration>
<Platform>x64</Platform>
@solvingj
solvingj / gist:a35fc1e6ef4084a2e8ca4f9ffbb13e7d
Created August 29, 2017 17:22
What tell sit to look for: x64BufferOverflowK.lib
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 8/29/2017 1:17:33 PM.
Project "C:\Users\jerry\.conan\data\npcap-npf\0.93\bincrafters\testing\build\e250637921ecc3c3a524c5654b7f98013709243c\n
pcap-0.93\packetWin7\npf\npf.sln" on node 1 (Build target(s)).
ValidateSolutionConfiguration:
Building solution configuration "Win7 Release SDV|x64".
Project "C:\Users\jerry\.conan\data\npcap-npf\0.93\bincrafters\testing\build\e250637921ecc3c3a524c5654b7f98013709243c\n
internal sealed class ExceptionalCommonLogic
{
public bool IsFailure { get; }
public bool IsSuccess => !IsFailure;
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private readonly Exception _exception;
public Exception Exception
{
@solvingj
solvingj / gist:84f8e0a6e6db5512efa0d5df01f0d529
Created May 19, 2017 17:19
Is this unit test valid? It succeeds, but I dunno if Task.Factory.StartNew really imitates an async task from a 3rd party library.
[Fact]
public async Task can_return_failed_exceptional_from_async_task_try()
{
Func<Task<int>> mathFunc = () => Task.Factory.StartNew(() => Int32.Parse(""));
Exceptional<int> exceptionalInt = await Tryable.Try(mathFunc);
//Assert
exceptionalInt.IsFailure.Should().BeTrue();
exceptionalInt.ToString().ShouldBeEquivalentTo("Input string was not in a correct format.");
public static class Tryable
{
public static Exceptional<T> Try<T>(Func<T> func)
{
try
{
return Exceptional.Ok(func());
}
catch (Exception e)
{