Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Fix when reverting a vessel so they are not fully removed from server
using LunaClient.Base; using LunaClient.Base.Interface; using LunaClient.Network; using LunaCommon.Message.Client; using LunaCommon.Message.Data.Vessel; using LunaCommon.Message.Interface; using System; namespace LunaClient.Systems.VesselRemoveSys { public class VesselRemoveMessageSender : SubSystem<VesselRemoveS...
using LunaClient.Base; using LunaClient.Base.Interface; using LunaClient.Network; using LunaCommon.Message.Client; using LunaCommon.Message.Data.Vessel; using LunaCommon.Message.Interface; using System; namespace LunaClient.Systems.VesselRemoveSys { public class VesselRemoveMessageSender : SubSystem<VesselRemoveS...
Use number provider for m_flStartTime
using System; using ValveResourceFormat.Serialization; namespace GUI.Types.ParticleRenderer.Emitters { public class InstantaneousEmitter : IParticleEmitter { public bool IsFinished { get; private set; } private readonly IKeyValueCollection baseProperties; private Action particleEmitCa...
using System; using ValveResourceFormat.Serialization; namespace GUI.Types.ParticleRenderer.Emitters { public class InstantaneousEmitter : IParticleEmitter { public bool IsFinished { get; private set; } private readonly IKeyValueCollection baseProperties; private Action particleEmitCa...
Clean up---cannot utilize dynamic loading of dll in VS.
namespace LanguageServer { //using Options; using System; using System.Collections.Generic; using System.Reflection; public class ManualAssemblyResolver : IDisposable { private readonly List<Assembly> _assemblies; public ManualAssemblyResolver() { AppDomai...
namespace LanguageServer { //using Options; using System; using System.Collections.Generic; using System.Reflection; public class GrammarDescriptionFactory { private static readonly IGrammarDescription _antlr = new AntlrGrammarDescription(); public static List<string> AllLangua...
Set up the basic program structure.
// ----------------------------------------------------------------------- // <copyright file="Program.cs" company="(none)"> // Copyright © 2013 John Gietzen. All Rights Reserved. // This source is subject to the MIT license. // Please see license.txt for more information. // </copyright> // -------------------...
// ----------------------------------------------------------------------- // <copyright file="Program.cs" company="(none)"> // Copyright © 2013 John Gietzen. All Rights Reserved. // This source is subject to the MIT license. // Please see license.txt for more information. // </copyright> // -------------------...
Add year to copyright attribute.
using System.Reflection; using System.Runtime.CompilerServices; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle("NDeproxy")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: As...
using System.Reflection; using System.Runtime.CompilerServices; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle("NDeproxy")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: As...
Fix null check to use string.IsNullOrEmpty. Even though unlikely, if a string.empty is passed as input it will result in an infinite loop.
namespace Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.Implementation { using System; using Microsoft.ApplicationInsights.Channel; /// <summary> /// Utility class for sampling score generation. /// </summary> internal static class SamplingScoreGenerator { /// <summ...
namespace Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.Implementation { using System; using Microsoft.ApplicationInsights.Channel; /// <summary> /// Utility class for sampling score generation. /// </summary> internal static class SamplingScoreGenerator { /// <summ...
Use AccessTokenConfiguration to register AuthInfo
using System; using Castle.MicroKernel.Registration; using Castle.MicroKernel.SubSystems.Configuration; using Castle.Windsor; using Castle.MicroKernel.Resolvers.SpecializedResolvers; namespace AppHarbor { public class AppHarborInstaller : IWindsorInstaller { public void Install(IWindsorContainer container, IConfi...
using System; using Castle.MicroKernel.Registration; using Castle.MicroKernel.SubSystems.Configuration; using Castle.Windsor; using Castle.MicroKernel.Resolvers.SpecializedResolvers; namespace AppHarbor { public class AppHarborInstaller : IWindsorInstaller { public void Install(IWindsorContainer container, IConfi...
Fix path to enum namespace
namespace EverlastingStudent.Models { using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using EverlastingStudent.Common; public class Difficulty { private ICollection<Homework> homeworks; private ICollection<FreelanceProject> freelanceProjects; ...
namespace EverlastingStudent.Models { using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using EverlastingStudent.Common.Models; public class Difficulty { private ICollection<Homework> homeworks; private ICollection<FreelanceProject> freelanceProjects; ...
Remove read ip from header
using System; using Abp.Auditing; using Castle.Core.Logging; using Microsoft.AspNetCore.Http; using Abp.Extensions; namespace Abp.AspNetCore.Mvc.Auditing { public class HttpContextClientInfoProvider : IClientInfoProvider { public string BrowserInfo => GetBrowserInfo(); public string ClientIpA...
using System; using Abp.Auditing; using Castle.Core.Logging; using Microsoft.AspNetCore.Http; using Abp.Extensions; namespace Abp.AspNetCore.Mvc.Auditing { public class HttpContextClientInfoProvider : IClientInfoProvider { public string BrowserInfo => GetBrowserInfo(); public string ClientIpA...
Increase default timeout to 30 secs
namespace Boxed.Templates.Test { using System; using System.Threading; public static class CancellationTokenFactory { public static CancellationToken GetCancellationToken(TimeSpan? timeout) => GetCancellationToken(timeout ?? TimeSpan.FromSeconds(20)); public static Cancella...
namespace Boxed.Templates.Test { using System; using System.Threading; public static class CancellationTokenFactory { public static CancellationToken GetCancellationToken(TimeSpan? timeout) => GetCancellationToken(timeout ?? TimeSpan.FromSeconds(30)); public static Cancella...
Add stub object storage credentials
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CenturyLinkCloudSDK.IntegrationTests { public static class Credentials { public static string Username = ""; public static string Password = ""; } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CenturyLinkCloudSDK.IntegrationTests { public static class Credentials { public static string Username = ""; public static string Password = ""; public static s...
Fix broken example notification after closing it and then changing options
using System.Windows.Forms; using TweetDuck.Plugins; using TweetDuck.Resources; namespace TweetDuck.Core.Notification.Example{ sealed class FormNotificationExample : FormNotificationMain{ public override bool RequiresResize => true; protected override bool CanDragWindow => Program.UserConfig.Notif...
using System.Windows.Forms; using TweetDuck.Core.Controls; using TweetDuck.Plugins; using TweetDuck.Resources; namespace TweetDuck.Core.Notification.Example{ sealed class FormNotificationExample : FormNotificationMain{ public override bool RequiresResize => true; protected override bool CanDragWin...
Allow `params` completion in lambdas
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Threading; using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery; namespace Microsoft.CodeAnaly...
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Threading; using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery; namespace Microsoft.CodeAnaly...
Fix crash when editing query parameters and one has a null value
using System.ComponentModel; using System.Linq; using System.Windows.Forms; using SolarWinds.InformationService.Contract2; namespace SwqlStudio { public partial class QueryParameters : Form { public QueryParameters(PropertyBag queryParameters) { InitializeComponent(); P...
using System.ComponentModel; using System.Linq; using System.Windows.Forms; using SolarWinds.InformationService.Contract2; namespace SwqlStudio { public partial class QueryParameters : Form { public QueryParameters(PropertyBag queryParameters) { InitializeComponent(); P...
Set Tentacle Instance Name variable
using System; using Octostache; namespace Calamari.Integration.Processes { public static class VariableDictionaryExtensions { public static void EnrichWithEnvironmentVariables(this VariableDictionary variables) { var environmentVariables = Environment.GetEnvironmentVariables(); ...
using System; using Calamari.Deployment; using Octostache; namespace Calamari.Integration.Processes { public static class VariableDictionaryExtensions { public static void EnrichWithEnvironmentVariables(this VariableDictionary variables) { var environmentVariables = Environment.GetE...
Update help with correct name
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using HtmlAgilityPack; namespace JenkinsTitleUpdater { class Program { static int Main(string[] args) { if (args.Length == 0) { Usage(); return -1; } HtmlDocu...
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using HtmlAgilityPack; namespace JenkinsTitleUpdater { class Program { static int Main(string[] args) { if (args.Length == 0) { Usage(); return -1; } HtmlDocu...
Fix error in comment (should have been NavStateChanged)
using System; namespace CefSharp { /// <summary> /// Event arguments to the LoadCompleted event handler set up in IWebBrowser. /// </summary> public class NavStateChangedEventArgs : EventArgs { public bool CanGoForward { get; private set; } public bool CanGoBack { get; private set;...
using System; namespace CefSharp { /// <summary> /// Event arguments to the NavStateChanged event handler set up in IWebBrowser. /// </summary> public class NavStateChangedEventArgs : EventArgs { public bool CanGoForward { get; private set; } public bool CanGoBack { get; private se...
Add function for configuring settings
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging;...
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging;...
Update addin version to 0.5
 using System; using Mono.Addins; using Mono.Addins.Description; [assembly:Addin ("TypeScript", Namespace = "MonoDevelop", Version = "0.4", Category = "Web Development")] [assembly:AddinName ("TypeScript")] [assembly:AddinDescription ("Adds TypeScript support. Updated to use TypeScript 1.4")] [assembly:AddinDepe...
 using System; using Mono.Addins; using Mono.Addins.Description; [assembly:Addin ("TypeScript", Namespace = "MonoDevelop", Version = "0.5", Category = "Web Development")] [assembly:AddinName ("TypeScript")] [assembly:AddinDescription ("Adds TypeScript support. Updated to use TypeScript 1.4")] [assembly:AddinDepe...
Add code to allow first-person character to control more like a traditional FPS.
using System.Collections; using System.Collections.Generic; using UnityEngine; public class CustomSimplePlayer : MonoBehaviour { public int speed = 10; Rigidbody rigidbody; Vector3 velocity; // Use this for initialization void Start () { rigidbody = GetComponent<Rigidbody>(); } // Updat...
using System.Collections; using System.Collections.Generic; using UnityEngine; public class CustomSimplePlayer : MonoBehaviour { public float speed = 10.0f; Rigidbody rigidbody; Vector3 velocity; // Use this for initialization void Start () { Cursor.lockState = CursorLockMode.Locked; ...
Fix an animation bug with Endless Sandwiches
using System.Collections.Generic; using HarryPotterUnity.Cards.Generic; using JetBrains.Annotations; namespace HarryPotterUnity.Cards.Spells.Charms { [UsedImplicitly] public class EndlessSandwiches : GenericSpell { protected override void SpellAction(List<GenericCard> targets) { wh...
using System.Collections.Generic; using HarryPotterUnity.Cards.Generic; using JetBrains.Annotations; namespace HarryPotterUnity.Cards.Spells.Charms { [UsedImplicitly] public class EndlessSandwiches : GenericSpell { protected override void SpellAction(List<GenericCard> targets) { in...
Update the properties test with new-style accessor syntax
using System; public struct Vector2 { public Vector2(double X, double Y) { this.x = X; this.Y = Y; } private double x; public double X { get { return x; } private set { x = value; } } public double Y { get; private set; } public double this[int i] { get { retur...
using System; public struct Vector2 { public Vector2(double X, double Y) { this.x = X; this.Y = Y; } private double x; public double X { get { return x; } private set { x = value; } } public double Y { get; private set; } public double this[int i] { get { retur...
Fix inverted result from Into(ModelState)
namespace Mios.Validation.Mvc { using System.Collections.Generic; using System.Web.Mvc; public static class ModelStateDictionaryExtensions { public static void AddErrors(this ModelStateDictionary modelState, IEnumerable<ValidationError> errors) { foreach(var error in errors) { modelState.AddModelEr...
namespace Mios.Validation.Mvc { using System.Collections.Generic; using System.Web.Mvc; public static class ModelStateDictionaryExtensions { public static void AddErrors(this ModelStateDictionary modelState, IEnumerable<ValidationError> errors) { foreach(var error in errors) { modelState.AddModelEr...
Add unit tests for simple single and multiple property resolution
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Xunit; namespace Pather.CSharp.UnitTests { // This project can output the Class library as a NuGet Package. // To enable this option, right-click on the project and select the Properties menu item. In the Bu...
using FluentAssertions; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Xunit; namespace Pather.CSharp.UnitTests { // This project can output the Class library as a NuGet Package. // To enable this option, right-click on the project and select the Propert...
Add Type Forwarder for New Appender
using System.Runtime.CompilerServices; [assembly:TypeForwardedTo(typeof(Gelf4Net.Layout.GelfLayout))] [assembly:TypeForwardedTo(typeof(Gelf4Net.Appender.GelfHttpAppender))] [assembly:TypeForwardedTo(typeof(Gelf4Net.Appender.GelfUdpAppender))] [assembly:TypeForwardedTo(typeof(Gelf4Net.Appender.AsyncGelfUdpAppender))] [...
using System.Runtime.CompilerServices; [assembly:TypeForwardedTo(typeof(Gelf4Net.Layout.GelfLayout))] [assembly:TypeForwardedTo(typeof(Gelf4Net.Appender.GelfHttpAppender))] [assembly:TypeForwardedTo(typeof(Gelf4Net.Appender.AsyncGelfHttpAppender))] [assembly:TypeForwardedTo(typeof(Gelf4Net.Appender.GelfUdpAppender))] ...
Return even information in string for error reporting
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Substructio.Logging { public interface IErrorReporting { void ReportError(Exception e); void ReportMessage(string message); } public class NullErrorReporting :...
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Substructio.Logging { public interface IErrorReporting { string ReportError(Exception e); string ReportMessage(string message); } public class NullErrorReporti...
Fix actual contingent table structure
@inherits DotNetNuke.Web.Mvc.Framework.DnnWebViewPage<ContingentViewModel> @using DotNetNuke.Web.Mvc.Helpers @using R7.University.EduProgramProfiles.ViewModels <td itemprop="eduCode">@Model.EduProgramProfile.EduProgram.Code</td> <td itemprop="eduName">@Model.EduProgramProfileTitle</td> <td itemprop="eduLevel">@...
@inherits DotNetNuke.Web.Mvc.Framework.DnnWebViewPage<ContingentViewModel> @using DotNetNuke.Web.Mvc.Helpers @using R7.University.EduProgramProfiles.ViewModels <td itemprop="eduCode">@Model.EduProgramProfile.EduProgram.Code</td> <td itemprop="eduName">@Model.EduProgramProfileTitle</td> <td itemprop="eduLevel">@...
Enable exceptions for this test case to speculatively fix the build bots.
// RUN: %check_clang_tidy %s hicpp-exception-baseclass %t namespace std { class exception {}; } // namespace std class derived_exception : public std::exception {}; class non_derived_exception {}; void problematic() { try { throw int(42); // Built in is not allowed // CHECK-MESSAGES: [[@LINE-1]]:5: warning: th...
// RUN: %check_clang_tidy %s hicpp-exception-baseclass %t -- -- -fcxx-exceptions namespace std { class exception {}; } // namespace std class derived_exception : public std::exception {}; class non_derived_exception {}; void problematic() { try { throw int(42); // Built in is not allowed // CHECK-MESSAGES: [[@...
Handle a little bug with empty files.
#include "mapped_file.h" #include <exception/os.h> #include <fcntl.h> #include <sys/mman.h> #include <sys/stat.h> namespace sasm { namespace utils { mapped_file::~mapped_file() { if (_is_mapped) unmap(); } void mapped_file::map() { int fd; struct stat buf; char* begin; if ((fd = open(get_path(), O...
#include "mapped_file.h" #include <exception/elf.h> #include <exception/os.h> #include <fcntl.h> #include <sys/mman.h> #include <sys/stat.h> namespace sasm { namespace utils { mapped_file::~mapped_file() { if (_is_mapped) unmap(); } void mapped_file::map() { int fd; struct stat buf; char* begin; i...
Remove confusing transpose() in setLinSpaced() docs.
VectorXf v; v.setLinSpaced(5,0.5f,1.5f).transpose(); cout << v << endl;
VectorXf v; v.setLinSpaced(5,0.5f,1.5f); cout << v << endl;
Mark another test as flaky
//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===---------------------------...
//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===---------------------------...
Send correct exit code on test failure.
#include <cppunit/XmlOutputter.h> #include <cppunit/extensions/TestFactoryRegistry.h> #include <cppunit/ui/text/TestRunner.h> #include <cppunit/TestResult.h> #include <cppunit/TestResultCollector.h> #include "SystemTest.h" int main(int argc, char* argv[]) { CppUnit::TestResult controller; CppUnit::TestResult...
#include <cppunit/XmlOutputter.h> #include <cppunit/extensions/TestFactoryRegistry.h> #include <cppunit/ui/text/TestRunner.h> #include <cppunit/TestResult.h> #include <cppunit/TestResultCollector.h> #include "SystemTest.h" int main(int argc, char* argv[]) { CppUnit::TestResult controller; CppUnit::TestResult...
Make early exits, when active, more efficient
#include "common.th" // c <- multiplicand // d <- multiplier // b -> product .global imul imul: pushall(h,i,j) b <- 0 #if IMUL_EARLY_EXITS i <- d == 0 i <- c == 0 + i i <- i <> 0 jnzrel(i, L_done) #endif h <- 1 j <- d >> 31 // save sign bit in j j <- -j // convert sign...
#include "common.th" // c <- multiplicand // d <- multiplier // b -> product .global imul imul: #if IMUL_EARLY_EXITS b <- c == 0 d <- d &~ b // d = (c == 0) ? 0 : d b <- d <> 0 jzrel(b, L_done) #endif pushall(h,i,j) b <- 0 h <- 1 j <- d >> 31 // save sign bit in j j <- -j ...
Use progran name as default log entry prefix.
/** \file SysLog.h * \brief Declaration of class SysLog. * \author Dr. Johannes Ruscheinski */ /* * Copyright 2020 University Library of Tübingen * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by ...
/** \file SysLog.h * \brief Declaration of class SysLog. * \author Dr. Johannes Ruscheinski */ /* * Copyright 2020 University Library of Tübingen * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by ...
Make snippet run successfully again: the snippet for 'eval' was taking m=m.transpose() as an example of code that needs an explicit call to eval(), but that doesn't work anymore now that we have the clever assert detecting aliasing issues.
Matrix2f M = Matrix2f::Random(); Matrix2f m; m = M; cout << "Here is the matrix m:" << endl << m << endl; cout << "Now we want to replace m by its own transpose." << endl; cout << "If we do m = m.transpose(), then m becomes:" << endl; m = m.transpose() * 1; cout << m << endl << "which is wrong!" << endl; cout << "Now l...
Matrix2f M = Matrix2f::Random(); Matrix2f m; m = M; cout << "Here is the matrix m:" << endl << m << endl; cout << "Now we want to copy a column into a row." << endl; cout << "If we do m.col(1) = m.row(0), then m becomes:" << endl; m.col(1) = m.row(0); cout << m << endl << "which is wrong!" << endl; cout << "Now let us ...
Fix a syscall number for 64-bit arm
#define SYS_CLOCK_GETTIME 263 #include "linux_clock.cpp"
#ifdef BITS_64 #define SYS_CLOCK_GETTIME 113 #endif #ifdef BITS_32 #define SYS_CLOCK_GETTIME 263 #endif #include "linux_clock.cpp"
Check idle state for Ozone platform
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/idle.h" #include "base/basictypes.h" #if defined(USE_X11) #include "chrome/browser/idle_query_x11.h" #endif #if !defined(O...
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/idle.h" #include "base/basictypes.h" #if defined(USE_X11) #include "chrome/browser/idle_query_x11.h" #endif #if !defined(O...
Remove stale CHECK lines that should have been included in r277478
// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include <windows.h> HANDLE done; DWORD CALLBACK work_item(LPVOID) { int subscript = -1; volatile char stack_buffer[42]; stack_buffer[subscript] = 42; // CHECK: AddressSanitizer: stack-buffer-underflow on address [[ADDR:0x[0-9a-f]+]] /...
// RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include <windows.h> HANDLE done; DWORD CALLBACK work_item(LPVOID) { int subscript = -1; volatile char stack_buffer[42]; stack_buffer[subscript] = 42; // CHECK: AddressSanitizer: stack-buffer-underflow on address [[ADDR:0x[0-9a-f]+]] /...
Fix broken synth reg A gen
#include <stdint.h> #include "receiver.h" Receiver::Receiver( uint8_t spiClockPin, uint8_t spiDataPin, uint8_t spiSelectPin ) { this->driver.init(spiClockPin, spiDataPin, spiSelectPin); } void Receiver::setFrequency(uint16_t frequency) { uint16_t flO = (frequency - 479) / 2; uint16_t regN = ...
#include <stdint.h> #include "receiver.h" Receiver::Receiver( uint8_t spiClockPin, uint8_t spiDataPin, uint8_t spiSelectPin ) { this->driver.init(spiClockPin, spiDataPin, spiSelectPin); } void Receiver::setFrequency(uint16_t frequency) { uint16_t fLo = (frequency - 479) / 2; uint16_t regN = ...
Fix to avoid empty files. Could still be improved, but it is enough for now.
// Copyright 2015 Alessio Sclocco <a.sclocco@vu.nl> // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable la...
// Copyright 2015 Alessio Sclocco <a.sclocco@vu.nl> // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable la...
Add actual documentation link into calibration checker output
// this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*- // -- BEGIN LICENSE BLOCK ---------------------------------------------- // -- END LICENSE BLOCK ------------------------------------------------ //---------------------------------------------------------------------- /*!\file * * \author ...
// this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*- // -- BEGIN LICENSE BLOCK ---------------------------------------------- // -- END LICENSE BLOCK ------------------------------------------------ //---------------------------------------------------------------------- /*!\file * * \author ...
Speed up ASan unit tests by turning off symbolication
//===-- asan_test_main.cc -------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
//===-- asan_test_main.cc -------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
Load the denoiser module after initializing OSPRay
// Copyright 2018-2020 Intel Corporation // SPDX-License-Identifier: Apache-2.0 #include "GLFWOSPRayWindow.h" #include "example_common.h" using namespace ospray; using rkcommon::make_unique; int main(int argc, const char *argv[]) { bool denoiser = ospLoadModule("denoiser") == OSP_NO_ERROR; initializeOSPRay(argc...
// Copyright 2018-2020 Intel Corporation // SPDX-License-Identifier: Apache-2.0 #include "GLFWOSPRayWindow.h" #include "example_common.h" using namespace ospray; using rkcommon::make_unique; int main(int argc, const char *argv[]) { initializeOSPRay(argc, argv); bool denoiser = ospLoadModule("denoiser") == OSP_N...
Fix plugin data refreshing to work again.
// Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this // source code is governed by a BSD-style license that can be found in the // LICENSE file. #include "config.h" #include "PluginData.h" #include "PluginInfoStore.h" #undef LOG #include "webkit/glue/glue_util.h" #include "webkit/glue/webkit...
// Copyright (c) 2008, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of condi...
Test was restored, interval [<v>-1,<v>+1] was set for hue, saturation and value.
#include <gtest/gtest.h> #include "photoeffects.hpp" using namespace cv; TEST(photoeffects, SepiaFakeTest) { Mat src(10, 10, CV_8UC1), dst; EXPECT_EQ(0, sepia(src, dst)); } TEST(photoeffects, SepiaFailTest) { Mat src(10, 10, CV_8UC3), dst; EXPECT_EQ(1, sepia(src, dst)); } /* TEST(photoeffects, Se...
#include <gtest/gtest.h> #include "photoeffects.hpp" using namespace cv; TEST(photoeffects, SepiaFakeTest) { Mat src(10, 10, CV_8UC1), dst; EXPECT_EQ(0, sepia(src, dst)); } TEST(photoeffects, SepiaFailTest) { Mat src(10, 10, CV_8UC3), dst; EXPECT_EQ(1, sepia(src, dst)); } TEST(photoeffects, Sepia...
Add more iterator concept ordering tests.
/** * Test suite for the iterator_concepts_ordering.hpp header. */ #include <duck/detail/iterator_concepts_ordering.hpp> #include <boost/mpl/assert.hpp> BOOST_MPL_ASSERT((duck::is_more_specific_than< duck::BidirectionalIterator, duck::RandomAccessIterator>)); BOOST_MPL_ASS...
/** * Test suite for the iterator_concepts_ordering.hpp header. */ #include <duck/detail/iterator_concepts_ordering.hpp> #include <boost/mpl/assert.hpp> BOOST_MPL_ASSERT((duck::is_more_specific_than< duck::BidirectionalIterator, duck::RandomAccessIterator>)); BOOST_MPL_ASS...
Check vs Remove - not so not so clear
#include <vector> #include <iostream> #include <algorithm> #ifndef REMOVE_VALUES #ifndef CHECK_VALUES #error "define one of REMOVE_VALUES or CHECK_VALUES" #endif #endif #ifdef REMOVE_VALUES #ifdef CHECK_VALUES #error "define either REMOVE_VALUES or CHECK_VALUES" #endif #endif...
#include <vector> #include <iostream> #include <algorithm> #ifndef REMOVE_VALUES #ifndef CHECK_VALUES #error "define one of REMOVE_VALUES or CHECK_VALUES" #endif #endif #ifdef REMOVE_VALUES #ifdef CHECK_VALUES #error "define either REMOVE_VALUES or CHECK_VALUES" #endif #endif...
Make change parallel to guide
#include <proton/default_container.hpp> #include <proton/messaging_handler.hpp> #include <string> class ExampleHandler: public proton::messaging_handler { std::string url_; // The container has started void on_container_start(proton::container&) override { } // A message can be sent void...
#include <proton/default_container.hpp> #include <proton/messaging_handler.hpp> #include <string> class ExampleHandler: public proton::messaging_handler { std::string url_; // The container has started void on_container_start(proton::container& c) override { } // A message can be sent vo...
Fix compilation error in the focus manager by returning NULL from unimplemented function.
// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "views/focus/focus_manager.h" #include "base/logging.h" namespace views { void FocusManager::ClearNativeFocus() { NOTIMPLEMENTED();...
// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "views/focus/focus_manager.h" #include "base/logging.h" namespace views { void FocusManager::ClearNativeFocus() { NOTIMPLEMENTED();...
Remove test that compared an empty string to bool
#include "TestCommon.h" USING_NAMESPACE_KAI struct TestString : TestCommon { protected: void AddrequiredClasses() override { Reg().AddClass<bool>(); Reg().AddClass<int>(); Reg().AddClass<String>(); } }; TEST_F(TestString, TestBoolean) { Pointer<String> s0 = Reg().New<String>("...
#include "TestCommon.h" USING_NAMESPACE_KAI struct TestString : TestCommon { protected: void AddrequiredClasses() override { Reg().AddClass<bool>(); Reg().AddClass<int>(); Reg().AddClass<String>(); } }; TEST_F(TestString, TestCompare) { Pointer<String> s0 = Reg().New<String>("...
Set org name and app name
#include <QApplication> #include "mainwindow.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); }
#include <QApplication> #include "mainwindow.h" const QString APP_ORGNAME = "PepperNote"; const QString APP_APPNAME = "PepperNote"; int main(int argc, char *argv[]) { QCoreApplication::setOrganizationName(APP_ORGNAME); QCoreApplication::setApplicationName(APP_APPNAME); QApplication a(argc, argv); Mai...
Add explicit <string> include to byteswap test
/* * Copyright 2015 - 2017 gtalent2@gmail.com * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include <map> #include <ox/std/std.hpp> using namespace std; u...
/* * Copyright 2015 - 2017 gtalent2@gmail.com * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include <map> #include <string> #include <ox/std/std.hpp> usin...
Fix missing member initialization on Mac OS
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. #include <errno.h> #include "bin/utils.h" OSError::OSError() { set_code(errno); SetMessage(strerr...
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. #include <errno.h> #include "bin/utils.h" OSError::OSError() : code_(0), message_(NULL) { set_code(...
Remove dependency on importing std into global namespace.
#include <cstdlib> #include <stdio.h> #include <string.h> #include <set> #include <string> #include <assert.h> using namespace std; set<string> done; void dump_header(string header) { if (done.find(header) != done.end()) return; done.insert(header); FILE *f = fopen(header.c_str(), "r"); if (f == NU...
#include <cstdlib> #include <stdio.h> #include <string.h> #include <set> #include <string> #include <assert.h> std::set<std::string> done; void dump_header(std::string header) { if (done.find(header) != done.end()) return; done.insert(header); FILE *f = fopen(header.c_str(), "r"); if (f == NULL) { ...
Fix bug when timing is not set inc hannel
#include "channel.h" #include "timing/timingfactory.h" class Channel::Private { public: Private() : id(0) { } int id; QString target; QString certificate; TimingPtr timing; }; Channel::Channel() : d(new Private) { } Channel::Channel(const int &id, const QString &target, const QString...
#include "channel.h" #include "timing/timingfactory.h" class Channel::Private { public: Private() : id(0) { } int id; QString target; QString certificate; TimingPtr timing; }; Channel::Channel() : d(new Private) { } Channel::Channel(const int &id, const QString &target, const QString...
Add basic command line flag handling using cppassist/cmdline
int main(int argc, char* argv[]) { }
#include <iostream> #include <string> #include <cppassist/cmdline/ArgumentParser.h> int main(int argc, char* argv[]) { cppassist::ArgumentParser argParser; argParser.parse(argc, argv); auto inFileName = argParser.value("--input"); auto outFileName = argParser.value("--output"); auto outFileType = outFile...
Set TopLeft button text as QtChronos
#include "headers/mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); /*************************************************************************** * Create and set the settings button on the top left o...
#include "headers/mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); /*************************************************************************** * Create and set the settings button on the top left o...
Update recently-added test to use new __c11_ form of atomic builtins.
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686-apple-darwin9 | FileCheck %s struct A { _Atomic(int) i; A(int j); void v(int j); }; // Storing to atomic values should be atomic // CHECK: store atomic i32 void A::v(int j) { i = j; } // Initialising atomic values should not be atomic // CHECK-NOT: store atomic ...
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686-apple-darwin9 | FileCheck %s struct A { _Atomic(int) i; A(int j); void v(int j); }; // Storing to atomic values should be atomic // CHECK: store atomic i32 void A::v(int j) { i = j; } // Initialising atomic values should not be atomic // CHECK-NOT: store atomic ...
Clear spurious timing code from bounds_interence
#include <Halide.h> #include <sys/time.h> using namespace Halide; double currentTime() { timeval t; gettimeofday(&t, NULL); return t.tv_sec * 1000.0 + t.tv_usec / 1000.0f; } int main(int argc, char **argv) { Func f, g, h; Var x, y; h(x) = x; g(x) = h(x-1) + h(x+1); f(x, y) = (g(x-1)...
#include <Halide.h> using namespace Halide; int main(int argc, char **argv) { Func f, g, h; Var x, y; h(x) = x; g(x) = h(x-1) + h(x+1); f(x, y) = (g(x-1) + g(x+1)) + y; h.root(); g.root(); if (use_gpu()) { f.cudaTile(x, y, 16, 16); g.cudaTile(x, 128); h.cudaT...
Add a missing target requirement.
// RUN: rm -rf %t // RUN: pp-trace -ignore FileChanged,MacroDefined %s -x objective-c++ -undef -target x86_64 -std=c++11 -fmodules -fcxx-modules -fmodules-cache-path=%t -I%S -I%S/Input | FileCheck --strict-whitespace %s // CHECK: --- @import Level1A; // CHECK-NEXT: - Callback: moduleImport // CHECK-NEXT: ImportLoc...
// RUN: rm -rf %t // RUN: pp-trace -ignore FileChanged,MacroDefined %s -x objective-c++ -undef -target x86_64 -std=c++11 -fmodules -fcxx-modules -fmodules-cache-path=%t -I%S -I%S/Input | FileCheck --strict-whitespace %s // REQUIRES: x86-registered-target // CHECK: --- @import Level1A; // CHECK-NEXT: - Callback: modul...
Set console log level to debug
#include "spaghetti/logger.h" namespace spaghetti::log { Logger g_loggerConsole{}; Logger g_loggerFile{}; void init() { if (!g_loggerConsole) g_loggerConsole = spdlog::stdout_color_mt("console"); if (!g_loggerFile) g_loggerFile = spdlog::basic_logger_mt("file", "spaghetti.log"); spdlog::set_pattern("[%Y.%m.%d...
#include "spaghetti/logger.h" namespace spaghetti::log { Logger g_loggerConsole{}; Logger g_loggerFile{}; void init() { if (!g_loggerConsole) g_loggerConsole = spdlog::stdout_color_mt("console"); if (!g_loggerFile) g_loggerFile = spdlog::basic_logger_mt("file", "spaghetti.log"); spdlog::set_pattern("[%Y.%m.%d...
Fix some more debugging fallout
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* * This file is part of the libone project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.or...
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* * This file is part of the libone project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.or...
Set focus on password field
#include "authdialog.h" #include <qconnman/manager.h> #include <qconnman/agent.h> #include <QDebug> AuthDialog::AuthDialog(Manager *manager, QWidget *parent): QDialog(parent), m_manager(manager) { ui.setupUi(this); connect(ui.showPassword, SIGNAL(toggled(bool)), SLOT(showPassword(bool))); } int Aut...
#include "authdialog.h" #include <qconnman/manager.h> #include <qconnman/agent.h> #include <QDebug> AuthDialog::AuthDialog(Manager *manager, QWidget *parent): QDialog(parent), m_manager(manager) { ui.setupUi(this); connect(ui.showPassword, SIGNAL(toggled(bool)), SLOT(showPassword(bool))); } int Aut...
Remove problemanic on VS test
// Copyright 2017, Dawid Kurek, <dawikur@gmail.com> #include "lel/operation/unary.hpp" #include "gtest/gtest.h" TEST(unary_test, logical_not_can_be_used_in_constexpr) { std::logical_not<> logical_not; static_assert(logical_not(false), ""); } TEST(unary_test, indirection_can_be_used_in_constexpr) { LeL::Opera...
// Copyright 2017, Dawid Kurek, <dawikur@gmail.com> #include "lel/operation/unary.hpp" #include "gtest/gtest.h" TEST(unary_test, logical_not_can_be_used_in_constexpr) { std::logical_not<> logical_not; static_assert(logical_not(false), ""); }
Add glfw window to texture demo
#include <iostream> #include <texturebased/polarmapped.h> int main(int /*argc*/, char* /*argv*/[]) { // TODO: glfw return 0; }
#include <iostream> #define GLFW_INCLUDE_NONE #include <GLFW/glfw3.h> #include <glbinding/Binding.h> #include <glbinding/gl/gl.h> #include <globjects/globjects.h> using namespace gl; void error(int errnum, const char * errmsg) { std::cerr << errnum << ": " << errmsg << std::endl; } void key_callback(GLFWwind...
Add sleep of 16 milliseconds for reduce framerate (High framerate make than my GPU do sharp creepy sound)
#include "ImwWindowManagerDX11.h" #include "ImwPlatformWindowDX11.h" #include <imgui_impl_dx11.h> using namespace ImWindow; ImwWindowManagerDX11::ImwWindowManagerDX11() { ImwPlatformWindowDX11::InitDX11(); } ImwWindowManagerDX11::~ImwWindowManagerDX11() { ImwPlatformWindowDX11::ShutdownDX11(); //ImGui_ImplDX11_S...
#include "ImwWindowManagerDX11.h" #include "ImwPlatformWindowDX11.h" #include <imgui_impl_dx11.h> using namespace ImWindow; ImwWindowManagerDX11::ImwWindowManagerDX11() { ImwPlatformWindowDX11::InitDX11(); } ImwWindowManagerDX11::~ImwWindowManagerDX11() { ImwPlatformWindowDX11::ShutdownDX11(); //ImGui_ImplDX11_S...
Create element for recorder endpoint
/* * RecorderEndPoint.cpp - Kurento Media Server * * Copyright (C) 2013 Kurento * Contact: Miguel París Díaz <mparisdiaz@gmail.com> * Contact: José Antonio Santos Cadenas <santoscadenas@kurento.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General ...
/* * RecorderEndPoint.cpp - Kurento Media Server * * Copyright (C) 2013 Kurento * Contact: Miguel París Díaz <mparisdiaz@gmail.com> * Contact: José Antonio Santos Cadenas <santoscadenas@kurento.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General ...
Include platform header before determining OS
// This file is distributed under the MIT license. // See the LICENSE file for details. #include <visionaray/detail/macros.h> #if defined(VSNRAY_OS_WIN32) #include <windows.h> #else #include <unistd.h> #endif #include "util.h" unsigned visionaray::get_num_processors() { #if defined(VSNRAY_OS_WIN32) SYSTEM_INFO...
// This file is distributed under the MIT license. // See the LICENSE file for details. #include <visionaray/detail/macros.h> #include <visionaray/detail/platform.h> #if defined(VSNRAY_OS_WIN32) #include <windows.h> #else #include <unistd.h> #endif #include "util.h" unsigned visionaray::get_num_processors() { #if d...
Remove unnecessary zeroing out of output buffer
#include <iostream> #include "floaxie/dtoa.h" using namespace std; using namespace floaxie; int main(int, char**) { double pi = 0.1; char buffer[128]; for (int i = 0; i < 128; ++i) buffer[i] = 0; dtoa(pi, buffer); std::cout << "pi: " << pi << ", buffer: " << buffer << std::endl; return 0; }
#include <iostream> #include "floaxie/dtoa.h" using namespace std; using namespace floaxie; int main(int, char**) { double pi = 0.1; char buffer[128]; dtoa(pi, buffer); std::cout << "pi: " << pi << ", buffer: " << buffer << std::endl; return 0; }
Fix compilation issue on older mac (< 10.12)
/* * System Call getentropy(2) * (C) 2017 Alexander Bluhm (genua GmbH) * * Botan is released under the Simplified BSD License (see license.txt) */ #include <botan/internal/getentropy.h> #if defined(BOTAN_TARGET_OS_IS_OPENBSD) || defined(BOTAN_TARGET_OS_IS_FREEBSD) || defined(BOTAN_TARGET_OS_IS_SOLARIS) #include <u...
/* * System Call getentropy(2) * (C) 2017 Alexander Bluhm (genua GmbH) * * Botan is released under the Simplified BSD License (see license.txt) */ #include <botan/internal/getentropy.h> #if defined(BOTAN_TARGET_OS_IS_OPENBSD) || defined(BOTAN_TARGET_OS_IS_FREEBSD) || defined(BOTAN_TARGET_OS_IS_SOLARIS) #include <u...
Fix bug where directories would fail to open when recursing
// // src/utils/directory.cc // tbd // // Created by inoahdev on 10/17/17. // Copyright © 2017 inoahdev. All rights reserved. // #include "directory.h" namespace utils { directory::open_result directory::open(const char *path) { dir = opendir(path); if (!dir) { return open_result::...
// // src/utils/directory.cc // tbd // // Created by inoahdev on 10/17/17. // Copyright © 2017 inoahdev. All rights reserved. // #include "directory.h" namespace utils { directory::open_result directory::open(const char *path) { this->path = path; this->dir = opendir(path); if (!dir) ...
Remove a line included to test the parser.
#include "robobo.h" #include "configuration.cpp" #include "servercapab.cpp" #include "socket.cpp" std::string input, command, currentNick; std::vector<std::string> inputParams; bool registered; int main(int argc, char** argv) { ConfigReader config; Socket bot_socket (config.getServer(), config.getPort()); bot_sock...
#include "robobo.h" #include "configuration.cpp" #include "servercapab.cpp" #include "socket.cpp" std::string input, command, currentNick; std::vector<std::string> inputParams; bool registered; int main(int argc, char** argv) { ConfigReader config; Socket bot_socket (config.getServer(), config.getPort()); bot_sock...
Apply initial transform in --skr mode.
#include "DMRecordTask.h" #include "DMUtil.h" #include "DMWriteTask.h" #include "SkCommandLineFlags.h" #include "SkRecording.h" DEFINE_bool(skr, false, "If true, run SKR tests."); namespace DM { RecordTask::RecordTask(const Task& parent, skiagm::GM* gm, SkBitmap reference) : CpuTask(parent) , fName(UnderJoin...
#include "DMRecordTask.h" #include "DMUtil.h" #include "DMWriteTask.h" #include "SkCommandLineFlags.h" #include "SkRecording.h" DEFINE_bool(skr, false, "If true, run SKR tests."); namespace DM { RecordTask::RecordTask(const Task& parent, skiagm::GM* gm, SkBitmap reference) : CpuTask(parent) , fName(UnderJoin...
Make deleted special member functions private.
// http://www.nuonsoft.com/blog/2017/08/10/implementing-a-thread-safe-singleton-with-c11-using-magic-statics/ // http://blog.mbedded.ninja/programming/languages/c-plus-plus/magic-statics #include <iostream> class CSingleton final { public: static CSingleton& GetInstance(); int getValue() const { return mValue; }...
// http://www.nuonsoft.com/blog/2017/08/10/implementing-a-thread-safe-singleton-with-c11-using-magic-statics/ // http://blog.mbedded.ninja/programming/languages/c-plus-plus/magic-statics #include <iostream> class CSingleton final { public: static CSingleton& GetInstance() { static CSingleton instance; retu...
Update to use static versions.
#include"qca.h" #include<stdio.h> int main(int argc, char **argv) { QCA::Initializer init; QCString cs = (argc >= 2) ? argv[1] : "hello"; if( !QCA::isSupported("sha1") ) printf("SHA1 not supported!\n"); else { QCA::SHA1 sha1Hash; QString result = sha1Hash.hashToString(cs); printf("sha1(\"%s\") = [%s]\n", ...
#include"qca.h" #include<stdio.h> int main(int argc, char **argv) { QCA::Initializer init; QCString cs = (argc >= 2) ? argv[1] : "hello"; if( !QCA::isSupported("sha1") ) printf("SHA1 not supported!\n"); else { QString result = QCA::SHA1().hashToString(cs); printf("sha1(\"%s\") = [%s]\n", cs.data(), result.l...
Update Problem 8 test case
#include "catch.hpp" #include "StringToInteger.hpp" TEST_CASE("String To Integer") { Solution s; SECTION("Normal tests") { REQUIRE(s.myAtoi("1") == 1); } SECTION("Normal tests 2") { REQUIRE(s.myAtoi(" 010") == 10); } }
#include "catch.hpp" #include "StringToInteger.hpp" TEST_CASE("String To Integer") { Solution s; SECTION("Normal tests") { REQUIRE(s.myAtoi("1") == 1); REQUIRE(s.myAtoi("378") == 378); REQUIRE(s.myAtoi("-239") == -239); REQUIRE(s.myAtoi("+832") == 832); } SECTION("Boundary tests") { REQU...
Change entity test to use fixtures
#include "component.h" #include "entity.h" #include "gtest/gtest.h" /* class TestC : public aronnax::Component { public: void update(aronnax::Entity &entity, const uint32_t dt) { return; } std::string getType() { return "TestComponent"; } }; class EntityTest : public testing::T...
#include "component.h" #include "entity.h" #include "gtest/gtest.h" /* class TestC : public aronnax::Component { public: void update(aronnax::Entity &entity, const uint32_t dt) { return; } std::string getType() { return "TestComponent"; } }; */ class EntityTest : public testing...
Fix incorrect operator in OrderingInfo
#include "orderinginfo.h" #include "defs.h" #include "eval.h" #include <cstring> OrderingInfo::OrderingInfo(const TranspTable* tt) { _tt = tt; _ply = 0; std::memset(_history, 0, sizeof(_history)); } void OrderingInfo::incrementHistory(Color color, int from, int to, int depth) { _history[color][from][to] += de...
#include "orderinginfo.h" #include "defs.h" #include "eval.h" #include <cstring> OrderingInfo::OrderingInfo(const TranspTable* tt) { _tt = tt; _ply = 0; std::memset(_history, 0, sizeof(_history)); } void OrderingInfo::incrementHistory(Color color, int from, int to, int depth) { _history[color][from][to] += de...
Use proper base 64 encoding for the watermark
#include <utils/unique_alias.hpp> #include <atomic> #include <chrono> #include <sstream> static std::atomic<int> __counter(0); utils::unique_alias::unique_alias() { std::ostringstream s; s << "benchmarks-" << std::chrono::duration_cast<std::chrono::seconds>( std::chrono::steady_clock::now...
#include <utils/unique_alias.hpp> #include <atomic> #include <chrono> #include <sstream> static std::atomic<int> __counter(0); static const char __base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; utils::unique_alias::unique_alias() { std::ostringstream s; s << "benchmarks-" ...
Add '<', '=', '>' as search delimeters.
#include "utf8_string.hpp" #include "../std/iterator.hpp" #include "../3party/utfcpp/source/utf8/unchecked.h" namespace utf8_string { bool Split(string const & str, vector<string> & out, IsDelimiterFuncT f) { out.clear(); string::const_iterator curr = str.begin(); string::const_iterator end = str.end...
#include "utf8_string.hpp" #include "../std/iterator.hpp" #include "../3party/utfcpp/source/utf8/unchecked.h" namespace utf8_string { bool Split(string const & str, vector<string> & out, IsDelimiterFuncT f) { out.clear(); string::const_iterator curr = str.begin(); string::const_iterator end = str.end...
Add a test case for operator *
// Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved. #include "stdafx.h" #include <autowiring/observable.h> class ObservableTest: public testing::Test {}; TEST_F(ObservableTest, SimpleAssignmentCheck) { autowiring::observable<int> ob; bool hit = false; ob.onChanged += [&hit] { hit = true; }; o...
// Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved. #include "stdafx.h" #include <autowiring/observable.h> class ObservableTest: public testing::Test {}; TEST_F(ObservableTest, SimpleAssignmentCheck) { autowiring::observable<int> ob; bool hit = false; ob.onChanged += [&hit] { hit = true; }; o...
Add some headers so we can use NanoVG to render NanoSVG.
#include "SVGImage.h" #define NANOSVG_IMPLEMENTATION #include <nanosvg.h> SVGImage::SVGImage() : _nanoSvgImage(nullptr) { } SVGImage::SVGImage(const boost::filesystem::path &path) : SVGImage() { open(path); } SVGImage::~SVGImage() { if (_nanoSvgImage) { ::nsvgDelete(_nanoSvgImage); } _nanoSvgImag...
#include "SVGImage.h" #define NANOSVG_IMPLEMENTATION #include <nanosvg.h> #include <nanovg.h> // XXX This is bad, but easy. #define NANOVG_GL_IMPLEMENTATION #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> #include <GLES2/gl2platform.h> #include <nanovg_gl.h> #include <nanovg.c> SVGImage::SVGImage() : _nanoSvgImage...
Remove bit field logic where not necessary
#include <cppfs/FileEventHandler.h> #include <cppfs/FileHandle.h> namespace cppfs { FileEventHandler::FileEventHandler() { } FileEventHandler::~FileEventHandler() { } void FileEventHandler::onFileEvent(FileHandle & fh, FileEvent event) { if (event & FileCreated) { onFileCreated(fh); } else if (e...
#include <cppfs/FileEventHandler.h> #include <cppfs/FileHandle.h> namespace cppfs { FileEventHandler::FileEventHandler() { } FileEventHandler::~FileEventHandler() { } void FileEventHandler::onFileEvent(FileHandle & fh, FileEvent event) { switch (event) { case FileCreated: onFileCreated(f...
Add example of creating BC for Laplaces eqn
#include "LinearEllipticPDE.hpp" double f1(Point const & point) { return point.x() * point.x(); } double f2(Point const & point) { return point.y() * point.y(); } int main() { // laplace ConstTensor I(3, 0.); I(0, 0) = I(1, 1) = I(2, 2) = 1.; LinearEllipticPDE LaplacesEquation3D(I, 0., zeroFunc); std::cout <<...
#include "LinearEllipticPDE.hpp" #include "BC.hpp" double g(Point const & point) { // u = g on Г return point.x() * point.y(); } int main() { // Laplace's eqn on the plane ConstTensor I(2, 0.); I(0, 0) = I(1, 1) = 1.; LinearEllipticPDE LaplacesEquation2D(I, 0., zeroFunc); BC myBC(g); // simple Dirichlet proble...
Fix wrong animation of boss arm
#include "level.hpp" using namespace engine; void Level::load(){ for(auto game_object : objects){ std::cout << "Loading " << game_object->name << std::endl; game_object->load(); for(auto hit : game_object->get_hitboxes()){ hit->initialize(); } } } void Level::free(){ for(auto game_object ...
#include "level.hpp" #include <iostream> using namespace engine; void Level::load(){ for(auto game_object : objects){ std::cout << "Loading " << game_object->name << std::endl; game_object->load(); for(auto hit : game_object->get_hitboxes()){ hit->initialize(); } } } void Level::free(){ f...
Add test scene with test scene system.
// // Copyright (C) Alexandr Vorontsov. 2017 // Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT). // #include "stdafx.h" #include <Kioto.h> #include <windows.h> void OnEngineInited() { Kioto::Scene* scene = new Kioto::Scene(); Kioto::SetScene(scene); OutputDebu...
// // Copyright (C) Alexandr Vorontsov. 2017 // Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT). // #include "stdafx.h" #include <Kioto.h> #include <windows.h> class TestScene : public Kioto::Scene { public: ~TestScene() { } }; class TestSceneSystem : public ...
Allow repeated input to reset frame counter
#include "InputHandler.h" #include "SFML/Window.hpp" #include "SFData.h" Player::Direction InputHandler::LastInput; int InputHandler::InputTime; bool InputHandler::WindowClosed = false; void InputHandler::PollEvents() { sf::Event event; while (SFData::Window->pollEvent(event)) { switch (event.type) { ...
#include "InputHandler.h" #include "SFML/Window.hpp" #include "SFData.h" Player::Direction InputHandler::LastInput; int InputHandler::InputTime; bool InputHandler::WindowClosed = false; void InputHandler::PollEvents() { sf::Event event; while (SFData::Window->pollEvent(event)) { switch (event.type) { ...
Add missing initialization of ManagedThread::run_state_
#include "vm/vm.hpp" #include "util/thread.hpp" #include "gc/managed.hpp" #include "shared_state.hpp" namespace rubinius { thread::ThreadData<ManagedThread*> _current_thread; ManagedThread::ManagedThread(uint32_t id, SharedState& ss, ManagedThread::Kind kind) : shared_(ss) , kind_(kind) , name_(kind ...
#include "vm/vm.hpp" #include "util/thread.hpp" #include "gc/managed.hpp" #include "shared_state.hpp" namespace rubinius { thread::ThreadData<ManagedThread*> _current_thread; ManagedThread::ManagedThread(uint32_t id, SharedState& ss, ManagedThread::Kind kind) : shared_(ss) , kind_(kind) , name_(kind ...
Work around a build error in a very hackish way.
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ozone/wayland/inputs/input_method_event_filter.h" #include "ui/base/ime/input_method.h" #include "ui/base/ime/input_method_factory.h" namespac...
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ozone/wayland/inputs/input_method_event_filter.h" #include "ui/base/ime/input_method.h" #include "ui/base/ime/input_method_factory.h" namespac...
Make a full json buffer first
#include "../http/client-channel.hh" #include "http-call.hh" #include "json.hh" namespace mimosa { namespace rpc { bool httpCall(const std::string &url, const google::protobuf::Message &request, google::protobuf::Message *response) { http::ClientChannel cc; http...
#include "../stream/string-stream.hh" #include "../stream/copy.hh" #include "../http/client-channel.hh" #include "http-call.hh" #include "json.hh" namespace mimosa { namespace rpc { bool httpCall(const std::string &url, const google::protobuf::Message &request, google::protob...
Add a RUN: line so this test doesn't fail.
// %llvmgcc %s -S -o - namespace std { class exception { }; class type_info { public: virtual ~type_info(); }; } namespace __cxxabiv1 { class __si_class_type_info : public std::type_info { ~__si_class_type_info(); }; } class recursive_init: public std::exception { public: virtual ~recursive_in...
// RUN: %llvmgcc %s -S -o - namespace std { class exception { }; class type_info { public: virtual ~type_info(); }; } namespace __cxxabiv1 { class __si_class_type_info : public std::type_info { ~__si_class_type_info(); }; } class recursive_init: public std::exception { public: virtual ~recursi...
Make a test independent of the default check set.
// RUN: clang-tidy %s -- --serialize-diagnostics %t | FileCheck %s // CHECK: :[[@LINE+1]]:12: error: expected ';' after struct [clang-diagnostic-error] struct A {}
// RUN: clang-tidy -checks=-*,llvm-namespace-comment %s -- -serialize-diagnostics %t | FileCheck %s // CHECK: :[[@LINE+1]]:12: error: expected ';' after struct [clang-diagnostic-error] struct A {}
Simplify this due to changes in the tblgen side
//===- AlphaSubtarget.cpp - Alpha Subtarget Information ---------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file was developed by Andrew Lenharth and is distributed under the // University of Illinois Open Source License. See LICENSE.TXT for details. // //===------------------...
//===- AlphaSubtarget.cpp - Alpha Subtarget Information ---------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file was developed by Andrew Lenharth and is distributed under the // University of Illinois Open Source License. See LICENSE.TXT for details. // //===------------------...
Update libraries to reflect screen hardware change
#include "lcd.h" #include <TFT.h> // Arduino LCD library // pin definition for LCD #define LCD_CS 10 #define LCD_DC 9 #define LCD_RST 8 namespace LCD { TFT TFTscreen = TFT(LCD_CS, LCD_DC, LCD_RST); void setup() { // initialize the display TFTscreen.begin(); // clear the screen with a black back...
#include "display.h" #include "sensor.h" #include <LiquidCrystal.h> // Arduino LCD library #include <Arduino.h> // enables use of byte pics // pin definition for LCD #define LCD_CS 10 #define LCD_DC 9 #define LCD_RST 8 namespace LCD { TFT TFTscreen = TFT(LCD_CS, LCD_DC, LCD_RST); void setup() { // ini...
Allow connections from the same user to DevTools server socket
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "content/public/browser/android/devtools_auth.h" #include "base/logging.h" namespace content { bool CanUserConnectToDevTools(uid_t uid, gi...
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "content/public/browser/android/devtools_auth.h" #include <unistd.h> #include <sys/types.h> #include "base/logging.h" namespace content { ...
Fix compilation error in HDD's unittest
#include "../src/utility.h" #include "../src/HDD/HardDrive.h" void unittest(){ const size_t emptyOff = 0x80120; HDD first(1,true); first.init(); int data[1000]; for(int i = 0 ; i < 1000 ; ++i){ data[i] = i; } first.writeaddr(emptyOff,&data,4*1000); int res; first.readaddr(...
#include "../src/utility.h" #include "../src/HDD/HardDrive.h" void unittest(){ const size_t emptyOff = 0x80120; HDD::HDD first(1,true); first.init(); int data[1000]; for(int i = 0 ; i < 1000 ; ++i){ data[i] = i; } first.writeaddr(emptyOff,&data,4*1000); int res; first.read...
Disable test that is failing on linux trybots.
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/test/base/ui_test_utils.h" IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ...
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/test/base/ui_test_utils.h" IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ...
Add fileExists and fileSize expression functions
#include "stdafx.h" #include "ExpressionFunctions.h" #include "Misc.h" #include "Common.h" ExpressionValue expressionFunctionEndianness(const std::vector<ExpressionValue>& parameters) { Endianness endianness = g_fileManager->getEndianness(); ExpressionValue result; result.type = ExpressionValueType::String; swit...
#include "stdafx.h" #include "ExpressionFunctions.h" #include "Misc.h" #include "Common.h" ExpressionValue expFuncEndianness(const std::vector<ExpressionValue>& parameters) { Endianness endianness = g_fileManager->getEndianness(); ExpressionValue result; result.type = ExpressionValueType::String; switch (endiann...
Fix gl error debug print.
/* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "GrGLConfig.h" #include "GrGLInterface.h" void GrGLClearErr(const GrGLInterface* gl) { while (GR_GL_NO_ERROR != gl->fGetError()) {} } void GrGLCheckErr(const ...
/* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "GrGLConfig.h" #include "GrGLInterface.h" void GrGLClearErr(const GrGLInterface* gl) { while (GR_GL_NO_ERROR != gl->fGetError()) {} } void GrGLCheckErr(const ...
Disable some shared lock tests
#include <Pith/Config.hpp> #include <Pith/LockGuard.hpp> #include <Pith/SharedLock.hpp> #include <gtest/gtest.h> using namespace Pith; TEST(SharedLock, multipleShared) { SharedLock lock; SharedLockGuard<SharedLock> shared1(lock); EXPECT_TRUE(trySharedLock(lock)); } TEST(SharedLock, failToTakeExclusive) { SharedL...
#include <Pith/Config.hpp> #include <Pith/LockGuard.hpp> #include <Pith/SharedLock.hpp> #include <gtest/gtest.h> using namespace Pith; TEST(SharedLock, multipleShared) { SharedLock lock; SharedLockGuard<SharedLock> shared1(lock); EXPECT_TRUE(trySharedLock(lock)); } TEST(SharedLock, DISABLED_failToTakeExclusive) {...