Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Fix wrong number of max open files |
#include "ReadFileManager.h" // Own interface
#include "ReadFile.h" // engine::ReadFile
namespace engine {
ReadFileManager::ReadFileManager()
{
// Default number of open files
max_open_files = 10;
}
ReadFile *ReadFileManager::getReadFile( std::string... |
#include "ReadFileManager.h" // Own interface
#include "ReadFile.h" // engine::ReadFile
namespace engine {
ReadFileManager::ReadFileManager()
{
// Default number of open files
max_open_files = 100;
}
ReadFile *ReadFileManager::getReadFile( std::strin... |
Fix logging resolution as chars. | //
// WindowSettings.cpp
// Hume
//
// Created by Marshall Clyburn on 7/11/14.
// Copyright (c) 2014 Marshall Clyburn. All rights reserved.
//
#include "WindowSettings.h"
namespace hm
{
/*
Default to a fullscreen window at the maximum
resolution supported by the attached screen.
*/
WindowSettings::WindowS... | //
// WindowSettings.cpp
// Hume
//
// Created by Marshall Clyburn on 7/11/14.
// Copyright (c) 2014 Marshall Clyburn. All rights reserved.
//
#include "WindowSettings.h"
namespace hm
{
/*
Default to a fullscreen window at the maximum
resolution supported by the attached screen.
*/
WindowSettings::WindowS... |
Update return datatype function 'createRandomPopulation'. | #include <iostream>
#include <cstdlib>
#include "population.h"
int **POPULATION::initializePopulation(int individuals, int genes, bool FILL_ZERO)
{
int **population;
if (!FILL_ZERO)
{
population = (int **) malloc(individuals * sizeof(int *));
for (int i = 0; i < individuals; i++)
population[i] = ... | #include <iostream>
#include <cstdlib>
#include "population.h"
int **POPULATION::initializePopulation(int individuals, int genes, bool FILL_ZERO)
{
int **population;
if (!FILL_ZERO)
{
population = (int **) malloc(individuals * sizeof(int *));
for (int i = 0; i < individuals; i++)
population[i] = ... |
Fix case where received message was potentially dropped in C++ bot | #include "connection.h"
hwo_connection::hwo_connection(const std::string& host, const std::string& port)
: socket(io_service)
{
tcp::resolver resolver(io_service);
tcp::resolver::query query(host, port);
boost::asio::connect(socket, resolver.resolve(query));
response_buf.prepare(8192);
}
hwo_connection::~hw... | #include "connection.h"
hwo_connection::hwo_connection(const std::string& host, const std::string& port)
: socket(io_service)
{
tcp::resolver resolver(io_service);
tcp::resolver::query query(host, port);
boost::asio::connect(socket, resolver.resolve(query));
response_buf.prepare(8192);
}
hwo_connection::~hw... |
Fix flashing in WebContents we create | #include "browser/inspectable_web_contents.h"
#include "browser/inspectable_web_contents_impl.h"
namespace brightray {
InspectableWebContents* InspectableWebContents::Create(const content::WebContents::CreateParams& create_params) {
return Create(content::WebContents::Create(create_params));
}
InspectableWebConte... | #include "browser/inspectable_web_contents.h"
#include "browser/inspectable_web_contents_impl.h"
#include "content/public/browser/web_contents_view.h"
namespace brightray {
InspectableWebContents* InspectableWebContents::Create(const content::WebContents::CreateParams& create_params) {
auto contents = content::We... |
Disable one MSAN test in AArch64 until we have a proper fix | // RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && not %run %t >%t.out 2>&1
// RUN: FileCheck %s < %t.out && FileCheck %s < %t.out
// RUN: %clangxx_msan -fsanitize-memory-track-origins -O3 %s -o %t && not %run %t >%t.out 2>&1
// RUN: FileCheck %s < %t.out && FileCheck %s < %t.out
// Test origin prop... | // RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && not %run %t >%t.out 2>&1
// RUN: FileCheck %s < %t.out && FileCheck %s < %t.out
// RUN: %clangxx_msan -fsanitize-memory-track-origins -O3 %s -o %t && not %run %t >%t.out 2>&1
// RUN: FileCheck %s < %t.out && FileCheck %s < %t.out
// Test origin prop... |
Remove missed use of config.h | //===------------------------- cxa_exception.cpp --------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//
// This file implements the "Exception ... | //===------------------------- cxa_exception.cpp --------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//
// This file implements the "Exception ... |
Adjust minor animated tiles transgression | #include <QtPlugin>
\
#include "animatedtilesplugin.h"
#include "animatedtilesitem.h"
AnimatedTilesPlugin::AnimatedTilesPlugin()
{
this->mName = "AnimatedTiles";
//This should not be an advertized plugin until it is implemented
//this->mRole = "animatedTiles";
}
Q_EXPORT_PLUGIN2(animatedTiles, AnimatedT... | #include <QtPlugin>
\
#include "animatedtilesplugin.h"
#include "animatedtilesitem.h"
AnimatedTilesPlugin::AnimatedTilesPlugin()
{
setName("AnimatedTiles");
//This should not be an advertized plugin until it is implemented
//setRole("animatedTiles");
}
Q_EXPORT_PLUGIN2(animatedTiles, AnimatedTilesPlugin... |
Fix altitude not being reported in metres to PFD | #include "AbsPositionOverview.h"
AbsPositionOverview::AbsPositionOverview(QObject *parent) :
QObject(parent)
{
}
void AbsPositionOverview::parseGpsRawInt(LinkInterface *link, const mavlink_message_t &message, const mavlink_gps_raw_int_t &state)
{
if (state.fix_type > 2)
{
this->setLat(state.lat);
... | #include "AbsPositionOverview.h"
AbsPositionOverview::AbsPositionOverview(QObject *parent) :
QObject(parent)
{
}
void AbsPositionOverview::parseGpsRawInt(LinkInterface *link, const mavlink_message_t &message, const mavlink_gps_raw_int_t &state)
{
if (state.fix_type > 2)
{
this->setLat(state.lat);
... |
Modify a couple tests to use asserts. | #include "gtest/gtest.h"
#include "Console.hpp"
#include <memory>
using namespace warbler;
class ConsoleTest
{
public:
static void noopCommandHandler(const std::shared_ptr<const std::vector<ConsoleArg>> &args) {};
static const std::shared_ptr<std::vector<ConsoleArgType>> args;
};
const std::shared_ptr<std::... | #include "gtest/gtest.h"
#include "Console.hpp"
#include <memory>
using namespace warbler;
class ConsoleTest
{
public:
static void noopCommandHandler(const std::shared_ptr<const std::vector<ConsoleArg>> &args) {};
static const std::shared_ptr<std::vector<ConsoleArgType>> args;
};
const std::shared_ptr<std::... |
Add support for reading input files from the command line. | #include <iostream>
#include "version.h"
#include "parser.h"
using namespace lean;
int main() {
std::cout << "Lean (version " << LEAN_VERSION_MAJOR << "." << LEAN_VERSION_MINOR << ")\n";
frontend f;
return parse_commands(f, std::cin) ? 0 : 1;
}
| #include <iostream>
#include <fstream>
#include "version.h"
#include "parser.h"
using namespace lean;
int main(int argc, char ** argv) {
std::cout << "Lean (version " << LEAN_VERSION_MAJOR << "." << LEAN_VERSION_MINOR << ")\n";
frontend f;
if (argc == 1) {
return parse_commands(f, std::cin) ? 0 : 1... |
Fix random drawing of cards | /*
* Deck.cpp
*
* Created on: 11.01.2017
* Author: Stefan
*/
#include <memory>
#include <random>
#include "Deck.h"
#include "Card.h"
#include "GlobalDeclarations.h"
void Deck::AddSets(std::size_t N)
{
for(std::size_t i = 0; i < N; ++i)
{
AddCompleteSet();
}
}
Deck::pCard Deck::Draw()
{
// Random gen... | /*
* Deck.cpp
*
* Created on: 11.01.2017
* Author: Stefan
*/
#include <memory>
#include <random>
#include "Deck.h"
#include "Card.h"
#include "GlobalDeclarations.h"
#include <chrono>
void Deck::AddSets(std::size_t N)
{
for(std::size_t i = 0; i < N; ++i)
{
AddCompleteSet();
}
}
Deck::pCard Deck::Draw(... |
Add extra argument to toggle board printing | #include <iostream>
#include <thread>
#include <vector>
#include "World.h"
using namespace std;
int main(int argc, char * argv[]) {
if (argc != 4) {
std::cerr << "use: " << argv[0] << " dim iterations nworkers\n";
return -1;
}
int dim = atoi(argv[1]);
int iterations = atoi(a... | #include <iostream>
#include <thread>
#include <vector>
#include "World.h"
using namespace std;
int main(int argc, char * argv[]) {
if (argc < 4) {
std::cerr << "use: " << argv[0] << " dim iterations nworkers ?[print: on]\n";
return -1;
}
int dim = atoi(argv[1]);
int iteratio... |
Fix for Release build break | // Copyright (c) 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 "chrome/browser/chromeos/status_area_button.h"
#include "app/gfx/canvas.h"
#include "app/gfx/skbitmap_operations.h"
#include "app/resource_b... | // Copyright (c) 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 "chrome/browser/chromeos/status_area_button.h"
#include "app/gfx/canvas.h"
#include "app/gfx/skbitmap_operations.h"
#include "app/resource_b... |
Fix Tools compilation under OS X | #ifdef __unix__
#include <iostream>
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
#include "Types.h"
#include "Tools.h"
void StartBotProcess(const BotConfig &Agent, const std::string& CommandLine, void **ProcessId)
{
FILE* pipe = popen(CommandLine.c_str(), "r");
if (!pipe)
{
std::ce... | #if defined(__unix__) || defined(__APPLE__)
#include <iostream>
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
#include "Types.h"
#include "Tools.h"
void StartBotProcess(const BotConfig &Agent, const std::string& CommandLine, void **ProcessId)
{
FILE* pipe = popen(CommandLine.c_str(), "r");
if (... |
Fix weird undefined reference to HookNative (GCC 4.5.2) | // Copyright (c) 2011 Zeex
//
// 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 law or agreed to in wri... | // Copyright (c) 2011 Zeex
//
// 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 law or agreed to in wri... |
Add further note to future self. | //
// SNA.cpp
// Clock Signal
//
// Created by Thomas Harte on 24/04/2021.
// Copyright © 2021 Thomas Harte. All rights reserved.
//
#include "SNA.hpp"
using namespace Storage::State;
std::unique_ptr<Analyser::Static::Target> SNA::load(const std::string &file_name) {
// 0x1a byte header:
//
// 00 I
// 01 HL'... | //
// SNA.cpp
// Clock Signal
//
// Created by Thomas Harte on 24/04/2021.
// Copyright © 2021 Thomas Harte. All rights reserved.
//
#include "SNA.hpp"
using namespace Storage::State;
std::unique_ptr<Analyser::Static::Target> SNA::load(const std::string &file_name) {
// 0x1a byte header:
//
// 00 I
// 01 HL'... |
Add missing call to begin() for MCP3208 object | /*
High_Temp.cpp
2014 Copyright (c) Seeed Technology Inc. All right reserved.
Loovee
2013-4-14
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the Lice... | /*
High_Temp.cpp
2014 Copyright (c) Seeed Technology Inc. All right reserved.
Loovee
2013-4-14
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the Lice... |
Write quaternion components instead of Euler angles | // Based on Euler.ino example
#include "NAxisMotion.h"
NAxisMotion imu;
unsigned long prevTime = 0;
const int streamPeriod = 20; // ms
void setup()
{
Serial.begin(115200);
I2C.begin();
imu.initSensor(); // I2C Address can be changed here if needed
imu.setOperationMode(OPERATION_MODE_NDOF);
// Default upda... |
#include "NAxisMotion.h"
NAxisMotion imu;
unsigned long prevTime = 0;
const int streamPeriod = 20; // ms
void setup()
{
Serial.begin(115200);
I2C.begin();
imu.initSensor(); // I2C Address can be changed here if needed
imu.setOperationMode(OPERATION_MODE_NDOF);
imu.setUpdateMode(MANUAL);
}
void loop()
{
... |
Check the output of this test. | // RUN: %clang_cc1 %s -emit-llvm-only -verify
// PR7291
struct Foo {
unsigned file_id;
Foo(unsigned arg);
};
Foo::Foo(unsigned arg) : file_id(arg = 42)
{ }
| // RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
// PR7291
struct Foo {
unsigned file_id;
Foo(unsigned arg);
};
Foo::Foo(unsigned arg) : file_id(arg = 42)
{ }
// CHECK: define void @_ZN3FooC2Ej
// CHECK: [[ARG:%.*]] = alloca i32
// CHECK: store i32 42, i32* [[ARG]]
// CHECK: [[ARGVAL:%.*]] = load i32* [[ARG... |
Fix bug in test; found by AddressSanitizer | //===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------... | //===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------... |
Replace malloc / free by new / delete for MICROFEATURE | /******************************************************************************
** Filename: mfdefs.cpp
** Purpose: Basic routines for manipulating micro-features
** Author: Dan Johnson
**
** (c) Copyright Hewlett-Packard Company, 1988.
** Licensed under the Apache License, Version 2.0 (the "License")... | /******************************************************************************
** Filename: mfdefs.cpp
** Purpose: Basic routines for manipulating micro-features
** Author: Dan Johnson
**
** (c) Copyright Hewlett-Packard Company, 1988.
** Licensed under the Apache License, Version 2.0 (the "License")... |
Update : make the updates.enabled switch usefull | /*
* File: NetworkThread.cpp
* Author: matthieu
*
* Created on 6 février 2015, 11:40
*/
#include "NetworkThread.h"
#include "RecalboxSystem.h"
#include "guis/GuiMsgBox.h"
NetworkThread::NetworkThread(Window* window) : mWindow(window){
// creer le thread
mFirstRun = true;
mRunning = true;
... | /*
* File: NetworkThread.cpp
* Author: matthieu
*
* Created on 6 février 2015, 11:40
*/
#include "NetworkThread.h"
#include "RecalboxSystem.h"
#include "guis/GuiMsgBox.h"
NetworkThread::NetworkThread(Window* window) : mWindow(window){
// creer le thread
mFirstRun = true;
mRunning = true;
... |
Adjust tap throttle max persistence queue size up to 500k | /* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
#include "config.h"
#include "tapthrottle.hh"
const size_t MINIMUM_SPACE(1024 * 1024);
const size_t MAXIMUM_QUEUE(100000);
bool TapThrottle::persistenceQueueSmallEnough() const {
size_t queueSize = stats.queue_size.get() + stats.flus... | /* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
#include "config.h"
#include "tapthrottle.hh"
const size_t MINIMUM_SPACE(1024 * 1024);
const size_t MAXIMUM_QUEUE(500000);
bool TapThrottle::persistenceQueueSmallEnough() const {
size_t queueSize = stats.queue_size.get() + stats.flus... |
Add sleep in WebSocket poll | #include "WebSocketWrapper.hpp"
#include <iostream>
using namespace rtcdcpp;
WebSocketWrapper::WebSocketWrapper(std::string url) : url(url), send_queue() { ; }
WebSocketWrapper::~WebSocketWrapper() { delete this->ws; }
bool WebSocketWrapper::Initialize() {
this->ws = WebSocket::from_url(this->url);
return this... | #include "WebSocketWrapper.hpp"
#include <thread>
#include <iostream>
using namespace rtcdcpp;
WebSocketWrapper::WebSocketWrapper(std::string url) : url(url), send_queue() { ; }
WebSocketWrapper::~WebSocketWrapper() { delete this->ws; }
bool WebSocketWrapper::Initialize() {
this->ws = WebSocket::from_url(this->ur... |
Add a TODO to not forget some tasks | #define SOFA_COMPONENT_COLLISION_CYLINDERMODEL_CPP
#include "CylinderModel.inl"
namespace sofa
{
namespace component
{
namespace collision
{
using namespace sofa::defaulttype;
using namespace sofa::core::collision;
using namespace helper;
SOFA_DECL_CLASS(Cylinder)
int RigidCylinderModelClass = core::RegisterObjec... | #define SOFA_COMPONENT_COLLISION_CYLINDERMODEL_CPP
#include "CylinderModel.inl"
namespace sofa
{
namespace component
{
namespace collision
{
using namespace sofa::defaulttype;
using namespace sofa::core::collision;
using namespace helper;
SOFA_DECL_CLASS(Cylinder)
int RigidCylinderModelClass = core::RegisterObjec... |
Use the Fusion Qt Style on OS X | #include "Server.h"
#include "IgnoreDebugOutput.h"
#include "StdinNotifier.h"
#include <QApplication>
#include <iostream>
#ifdef Q_OS_UNIX
#include <unistd.h>
#endif
int main(int argc, char **argv) {
#ifdef Q_OS_UNIX
if (setpgid(0, 0) < 0) {
std::cerr << "Unable to set new process group." << std::endl;
ret... | #include "Server.h"
#include "IgnoreDebugOutput.h"
#include "StdinNotifier.h"
#include <QApplication>
#include <iostream>
#ifdef Q_OS_UNIX
#include <unistd.h>
#endif
int main(int argc, char **argv) {
#ifdef Q_OS_UNIX
if (setpgid(0, 0) < 0) {
std::cerr << "Unable to set new process group." << std::endl;
ret... |
Use QScopedPointer instead of std::auto_ptr, per Daniel's request | #include <QtCore/QSettings>
#include <QtCore/QVariant>
#include <QtGui/QApplication>
#include <QtGui/QFont>
#include <memory>
extern "C" {
#include <libxslt/xslt.h>
#include <libxml/parser.h>
#include <libxml/xpath.h>
#include <libexslt/exslt.h>
}
#include "DactMainWindow.h"
int main(int argc, char *argv[])
{
Q... | #include <QtCore/QSettings>
#include <QtCore/QVariant>
#include <QtGui/QApplication>
#include <QtGui/QFont>
#include <QScopedPointer>
extern "C" {
#include <libxslt/xslt.h>
#include <libxml/parser.h>
#include <libxml/xpath.h>
#include <libexslt/exslt.h>
}
#include "DactMainWindow.h"
int main(int argc, char *argv[])
... |
Correct syntax error in line 25 | #include<cmath>
#include<iostream>
using namespace std;
bool isPrimeBruteForce(int x)
{
if (x < 2)
return false;
float sqroot_x = sqrt(x);
for(int i=0; i <= sqroot_x; i++) { /* If there were only factors above the square root of x, they would be bigger than x itself. */
if (x%i==0)
return false;
}
return ... | #include<cmath>
#include<iostream>
using namespace std;
bool isPrimeBruteForce(int x)
{
if (x < 2)
return false;
float sqroot_x = sqrt(x);
for(int i=0; i <= sqroot_x; i++) { /* If there were only factors above the square root of x, they would be bigger than x itself. */
if (x%i==0)
return false;
}
return ... |
Reduce WebSocket poll delay to 50ms | #include "WebSocketWrapper.hpp"
#include <thread>
#include <iostream>
using namespace rtcdcpp;
WebSocketWrapper::WebSocketWrapper(std::string url) : url(url), send_queue() { ; }
WebSocketWrapper::~WebSocketWrapper() { delete this->ws; }
bool WebSocketWrapper::Initialize() {
this->ws = WebSocket::from_url(this->ur... | #include "WebSocketWrapper.hpp"
#include <thread>
#include <iostream>
using namespace rtcdcpp;
WebSocketWrapper::WebSocketWrapper(std::string url) : url(url), send_queue() { ; }
WebSocketWrapper::~WebSocketWrapper() { delete this->ws; }
bool WebSocketWrapper::Initialize() {
this->ws = WebSocket::from_url(this->ur... |
Add simple C++ stub for testing protobuf definitions | #include <iostream>
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "google/protobuf/util/json_util.h"
#include "src/protobuf/test.pb.h"
int main() {
// verify link and compile versions are the same
GOOGLE_PROTOBUF_VERIFY_VERSION;
// testing absl
std::cout << absl::StrCat("H... | #include <iostream>
#include <string>
// #include "absl/strings/str_cat.h"
// #include "absl/strings/string_view.h"
#include "google/protobuf/util/json_util.h"
#include "src/protobuf/bmv2/program.pb.h"
void ReadStdin(std::string& str) {
std::istreambuf_iterator<char> cin_iterator{std::cin};
std::istreambuf_itera... |
Add missing header file for Ubuntu Jaunty and beyond | /*
* BasicLayout.cpp
*
* Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
* Copyright 2000, Bastiaan Bakker. All rights reserved.
*
* See the COPYING file for the terms of usage and distribution.
*/
#include "PortabilityImpl.hh"
#include <log4cpp/BasicLayout.hh>
#include <log4cpp/Pri... | /*
* BasicLayout.cpp
*
* Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
* Copyright 2000, Bastiaan Bakker. All rights reserved.
*
* See the COPYING file for the terms of usage and distribution.
*/
#include "PortabilityImpl.hh"
#include <log4cpp/BasicLayout.hh>
#include <log4cpp/Pri... |
Use Parser module to parse a file | #include "Interpreter.hpp"
#include "modules/error-handler/ErrorHandler.hpp"
#include "modules/lexer/Lexer.hpp"
#include <iostream>
using Interpreter = tkom::Interpreter;
using ErrorHandler = tkom::modules::ErrorHandler;
using Lexer = tkom::modules::Lexer;
Interpreter::Interpreter(const std::vector<std::string>& ar... | #include "Interpreter.hpp"
#include "modules/error-handler/ErrorHandler.hpp"
#include "modules/lexer/Lexer.hpp"
#include "modules/parser/Parser.hpp"
using Interpreter = tkom::Interpreter;
using ErrorHandler = tkom::modules::ErrorHandler;
using Lexer = tkom::modules::Lexer;
using Parser = tkom::modules::Parser;
Inter... |
Mark ExtensionApiTest.Popup as FLAKY, it is still flaky. | // Copyright (c) 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 "base/command_line.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/common/chrome_switches.h"
IN_PROC_BROWSER_T... | // Copyright (c) 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 "base/command_line.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/common/chrome_switches.h"
// Flaky, http://c... |
Set mobile=true when calling setDeviceMetricsOverride | // Copyright 2014 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/test/chromedriver/chrome/device_metrics.h"
DeviceMetrics::DeviceMetrics(int width, int height, double device_scale_factor)
: width(wid... | // Copyright 2014 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/test/chromedriver/chrome/device_metrics.h"
DeviceMetrics::DeviceMetrics(int width, int height, double device_scale_factor)
: width(wid... |
Add flushes to try to fix test | // RUN: %clang_cl_asan -O0 %s -Fe%t
// RUN: env ASAN_OPTIONS=handle_segv=0 %run %t 2>&1 | FileCheck %s --check-prefix=USER
// RUN: env ASAN_OPTIONS=handle_segv=1 not %run %t 2>&1 | FileCheck %s --check-prefix=ASAN
// Test the default.
// RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=ASAN
// This test exits zero ... | // RUN: %clang_cl_asan -O0 %s -Fe%t
// RUN: env ASAN_OPTIONS=handle_segv=0 %run %t 2>&1 | FileCheck %s --check-prefix=USER
// RUN: env ASAN_OPTIONS=handle_segv=1 not %run %t 2>&1 | FileCheck %s --check-prefix=ASAN
// Test the default.
// RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=ASAN
// This test exits zero ... |
Add test for Example 1. | #define BOOST_TEST_MAIN
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE flatten_tests
#include <boost/test/unit_test.hpp>
#include "flatten/flatten.hpp"
BOOST_AUTO_TEST_CASE(flatten_tests)
{
}
| #define BOOST_TEST_MAIN
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE flatten_tests
#include <boost/test/unit_test.hpp>
#include <list>
#include <vector>
#include <map>
#include "flatten/flatten.hpp"
typedef std::vector<int> IntList;
typedef std::vector<IntList> IntListList;
typedef std::vector<IntListList> ... |
Remove inclusion of unversioned header. | // ========================================================================== //
// This file is part of DO++, a basic set of libraries in C++ for computer
// vision.
//
// Copyright (C) 2013 David Ok <david.ok8@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License v. 2.0. If... | // ========================================================================== //
// This file is part of DO++, a basic set of libraries in C++ for computer
// vision.
//
// Copyright (C) 2013 David Ok <david.ok8@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License v. 2.0. If... |
Add basic config file support | #include <iostream>
#include <cstdlib>
#include "NTClient.h"
using namespace std;
void initBot() {
NTClient nclient = NTClient(20, 0.89);
nclient.login("sascf3", "123asd123"); // Throw-away account
nclient.connect();
}
int main(int argc, char** argv) {
srand(static_cast<unsigned int>(time(0)));
initBot();
return... | #include <iostream>
#include <cstdlib>
#include <fstream>
#include "NTClient.h"
#include "colors.h"
#include "json.hpp"
using namespace std;
void initBot(string username, string password, int wpm, double acc) {
NTClient nclient = NTClient(wpm, acc);
nclient.login(username, password);
nclient.connect();
}
void initl... |
Implement first basic black window setup without any content | #include <iostream>
int main(int argc, char** argv) {
std::cout << "Hello Lamure Virtual Texture!\n";
return 0;
}
| #include <iostream>
// scism shit
#include <scm/core.h>
#include <scm/log.h>
#include <scm/core/pointer_types.h>
#include <scm/core/io/tools.h>
#include <scm/core/time/accum_timer.h>
#include <scm/core/time/high_res_timer.h>
#include <scm/gl_core.h>
#include <scm/gl_util/data/imaging/texture_loader.h>
#... |
Change tests in JPetAnalysisTools to use double instead of int | #define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE JPetEventTest
#include <boost/test/unit_test.hpp>
#include "../JPetAnalysisTools/JPetAnalysisTools.h"
BOOST_AUTO_TEST_SUITE(FirstSuite)
BOOST_AUTO_TEST_CASE(constructor_getHitsOrderedByTime)
{
std::vector<JPetHit> hits(4);
hits[0].setTime(2);
hits[1].setTi... | #define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE JPetEventTest
#include <boost/test/unit_test.hpp>
#include "../JPetAnalysisTools/JPetAnalysisTools.h"
BOOST_AUTO_TEST_SUITE(FirstSuite)
BOOST_AUTO_TEST_CASE(constructor_getHitsOrderedByTime)
{
std::vector<JPetHit> hits(4);
hits[0].setTime(2);
hits[1].setTi... |
Fix TSan symbol lookup on Windows | //===--- ThreadSanitizer.cpp - Thread Sanitizer support -------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | //===--- ThreadSanitizer.cpp - Thread Sanitizer support -------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... |
Fix vexing parse in test. | //===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------... | //===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------... |
Extend slider use case test | // Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved.
#include "stdafx.h"
#include <autowiring/config_descriptor.h>
#include <autowiring/config.h>
#include <autowiring/ConfigRegistry.h>
#include <autowiring/observable.h>
namespace aw = autowiring;
class AutoConfig_SliderTest :
public testing::Test
{};
... | // Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved.
#include "stdafx.h"
#include <autowiring/config_descriptor.h>
#include <autowiring/config.h>
#include <autowiring/ConfigRegistry.h>
#include <autowiring/observable.h>
namespace aw = autowiring;
class AutoConfig_SliderTest :
public testing::Test
{};
... |
Improve main declaration to include runtime start | //=======================================================================
// Copyright Baptiste Wicht 2011.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//=====================================================... | //=======================================================================
// Copyright Baptiste Wicht 2011.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//=====================================================... |
Fix build when libpfm is not available. | //===-- PerfHelperTest.cpp --------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | //===-- PerfHelperTest.cpp --------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
Enable GPU support for Zeta and Polygamma ops. | /* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
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 law or a... | /* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
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 law or a... |
Support to specify single QML file by argument | #include <QApplication>
#include <QQmlApplicationEngine>
#include <QDir>
#include <QFile>
#include <QFileInfo>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QQmlApplicationEngine engine;
if (argc < 2) {
printf("Usage: OwaViewer [directory]\n");
return 1;
}
QDir dirPath(argv[1]);
QString... | #include <QApplication>
#include <QQmlApplicationEngine>
#include <QDir>
#include <QFile>
#include <QFileInfo>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QQmlApplicationEngine engine;
if (argc < 2) {
printf("Usage: OwaViewer [directory]\n");
printf(" or: OwaViewer [File]\n");
return ... |
Remove comment and redundant include | #include "cameras/itf/pinhole_camera.h"
#include "core/itf/film.h"
#include "core/itf/ray.h"
#include "core/itf/sampling.h"
#include <iostream>
using namespace lb;
/// Constructs a pinhole camera, where the image plane's origin is pointed to
/// the by the look at vector relative from the camera's location. Togethe... | #include "cameras/itf/pinhole_camera.h"
#include "core/itf/film.h"
#include "core/itf/ray.h"
#include "core/itf/sampling.h"
using namespace lb;
/// Constructs a pinhole camera, where the image plane's origin is pointed to
/// the by the look at vector relative from the camera's location. Together with
/// the look a... |
Use __SIZE_TYPE__ as suggested by dgregor. | // RUN: %clang_cc1 -fsyntax-only -verify %s
// Various tests for -fno-exceptions
typedef __typeof(sizeof(int)) size_t;
namespace test0 {
// rdar://problem/7878149
class Foo {
public:
void* operator new(size_t x);
private:
void operator delete(void *x);
};
void test() {
// Under -fexceptions,... | // RUN: %clang_cc1 -fsyntax-only -verify %s
// Various tests for -fno-exceptions
typedef __SIZE_TYPE__ size_t;
namespace test0 {
// rdar://problem/7878149
class Foo {
public:
void* operator new(size_t x);
private:
void operator delete(void *x);
};
void test() {
// Under -fexceptions, this do... |
Increase the QImageReader allocation limit. | /*
Copyright (c), Helios
All rights reserved.
Distributed under a permissive license. See COPYING.txt for details.
*/
#include "ImageViewerApplication.h"
int main(int argc, char **argv){
try{
initialize_supported_extensions();
ImageViewerApplication app(argc, argv, "BorderlessViewer" + get_per_user_... | /*
Copyright (c), Helios
All rights reserved.
Distributed under a permissive license. See COPYING.txt for details.
*/
#include "ImageViewerApplication.h"
#include <QImageReader>
int main(int argc, char **argv){
try{
//Set the limit to 1 GiB.
QImageReader::setAllocationLimit(1024);
initialize_sup... |
Revert SAL_N_ELEMENTS change for one file | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
// SOComWindowPeer.cpp : Implementation of CHelpApp and DLL registration.
#include "stdafx2.h"
#include "so_activex.h"
#include "SOComWindowPeer.h"
/////////////////////////////////////////////////////////////////////////////
//
STDMETHO... | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
// SOComWindowPeer.cpp : Implementation of CHelpApp and DLL registration.
#include "stdafx2.h"
#include "so_activex.h"
#include "SOComWindowPeer.h"
/////////////////////////////////////////////////////////////////////////////
//
STDMETHO... |
Fix a build error when OS_CHROMEOS is not defined. | // 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_input_method_api.h"
#include "base/values.h"
#include "chrome/browser/chromeos/input_method/input_metho... | // 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_input_method_api.h"
#include "base/values.h"
#include "chrome/browser/chromeos/input_method/input_metho... |
Remove unused finder on traceroute parse command | #include <iostream>
#include <string>
#include <maproute/ip.hpp>
#include <maproute/ip_convertor.hpp>
#include <maproute/stringhelp.hpp>
#include <maproute/tr_parser.hpp>
#include <maproute/ip_location_finder.hpp>
int main() {
IPLocationFinder finder{};
while (std::cin.good()) {
std::string line;
... | #include <iostream>
#include <string>
#include <maproute/ip.hpp>
#include <maproute/ip_convertor.hpp>
#include <maproute/stringhelp.hpp>
#include <maproute/tr_parser.hpp>
#include <maproute/ip_location_finder.hpp>
int main() {
while (std::cin.good()) {
std::string line;
std::string ip_string;
... |
Change print to match actual content of ka, kd, ks. | #include "material.hpp"
Material::Material():
name{},
ka{0,0,0},
kd{0,0,0},
ks{0,0,0},
m{0}
{}
Material::Material(std::string const& name, Color const& ka, Color const& kd,
Color const& ks, float m):
name{name},
ka{ka},
kd{kd},
... | #include "material.hpp"
Material::Material():
name{},
ka{0,0,0},
kd{0,0,0},
ks{0,0,0},
m{0}
{}
Material::Material(std::string const& name, Color const& ka, Color const& kd,
Color const& ks, float m):
name{name},
ka{ka},
kd{kd},
... |
Change sanity check for perfomance test of dft | #include "perf_precomp.hpp"
using namespace std;
using namespace cv;
using namespace perf;
using std::tr1::make_tuple;
using std::tr1::get;
#define MAT_TYPES_DFT CV_32FC1, CV_64FC1
#define MAT_SIZES_DFT sz1080p, sz2K
#define TEST_MATS_DFT testing::Combine(testing::Values(MAT_SIZES_DFT), testing::Values(MAT_TYPES_D... | #include "perf_precomp.hpp"
using namespace std;
using namespace cv;
using namespace perf;
using std::tr1::make_tuple;
using std::tr1::get;
#define MAT_TYPES_DFT CV_32FC1, CV_64FC1
#define MAT_SIZES_DFT sz1080p, sz2K
#define TEST_MATS_DFT testing::Combine(testing::Values(MAT_SIZES_DFT), testing::Values(MAT_TYPES_D... |
Add test to cover unable to open file | #include "test/catch.hpp"
#include <string>
#include <vector>
#include "main/exception/FileOpenException.hpp"
#include "main/exception/InvalidArgumentException.hpp"
#include "main/MainApp.hpp"
TEST_CASE("MainApp class") {
using std::string;
using std::vector;
using pyconv::exception::FileOpenException;
... | #include "test/catch.hpp"
#include <string>
#include <vector>
#include "main/exception/FileOpenException.hpp"
#include "main/exception/InvalidArgumentException.hpp"
#include "main/MainApp.hpp"
TEST_CASE("MainApp class") {
using std::string;
using std::vector;
using pyconv::exception::FileOpenException;
... |
Fix sigaction to be more portable. | /* -*- mode:linux -*- */
/**
* \file timeout.cc
*
*
*
* \author Ethan Burns
* \date 2008-12-16
*/
#include <iostream>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
using namespace std;
void alarm_action(int sig)
{
cout << "No Solution" << endl
<< "cost: infinity" << endl
<< "length... | /* -*- mode:linux -*- */
/**
* \file timeout.cc
*
*
*
* \author Ethan Burns
* \date 2008-12-16
*/
#include <iostream>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
using namespace std;
void alarm_action(int sig)
{
cout << "No Solution" << endl
<< "cost: infinity" << endl
<< "length... |
Fix SkNWayCanvas cons call when creating null canvas. | /*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkNullCanvas.h"
#include "SkCanvas.h"
#include "SKNWayCanvas.h"
SkCanvas* SkCreateNullCanvas() {
// An N-Way canvas forwards calls to N canvas's. When N == 0 ... | /*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkNullCanvas.h"
#include "SkCanvas.h"
#include "SKNWayCanvas.h"
SkCanvas* SkCreateNullCanvas() {
// An N-Way canvas forwards calls to N canvas's. When N == 0 ... |
Add simple memory model to consume latency of memory operations. Still needs them to be pushed. | #include "performance_model.h"
#include "log.h"
using std::endl;
SimplePerformanceModel::SimplePerformanceModel()
: m_instruction_count(0)
, m_cycle_count(0)
{
}
SimplePerformanceModel::~SimplePerformanceModel()
{
}
void SimplePerformanceModel::outputSummary(std::ostream &os)
{
os << " Instructions: " <... | #include "performance_model.h"
#include "log.h"
using std::endl;
SimplePerformanceModel::SimplePerformanceModel()
: m_instruction_count(0)
, m_cycle_count(0)
{
}
SimplePerformanceModel::~SimplePerformanceModel()
{
}
void SimplePerformanceModel::outputSummary(std::ostream &os)
{
os << " Instructions: " <... |
Fix compilation with GCC 4.1.1. | /*
Copyright 2007 Albert Strasheim <fullung@gmail.com>
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 law ... | /*
Copyright 2007 Albert Strasheim <fullung@gmail.com>
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 law ... |
Fix occlusion tester segment ray creation to behave like before | #include "scene.h"
#include "geometry/differential_geometry.h"
#include "lights/occlusion_tester.h"
void OcclusionTester::set_points(const Point &a, const Point &b){
float dist = a.distance(b);
ray = Ray{a, (b - a) / dist, 1e-6f, dist * (1.f - 1e-6f)};
}
void OcclusionTester::set_ray(const Point &p, const Vector &d)... | #include "scene.h"
#include "geometry/differential_geometry.h"
#include "lights/occlusion_tester.h"
void OcclusionTester::set_points(const Point &a, const Point &b){
ray = Ray{a, b - a, 1e-4f, 1};
}
void OcclusionTester::set_ray(const Point &p, const Vector &d){
ray = Ray{p, d.normalized(), 1e-4f};
}
bool OcclusionT... |
Fix use-after-free on database object | /*
* Copyright 2014 Cloudius Systems
*/
#include "database.hh"
#include "core/app-template.hh"
#include "core/smp.hh"
#include "thrift/server.hh"
namespace bpo = boost::program_options;
int main(int ac, char** av) {
app_template app;
app.add_options()
("thrift-port", bpo::value<uint16_t>()->defaul... | /*
* Copyright 2014 Cloudius Systems
*/
#include "database.hh"
#include "core/app-template.hh"
#include "core/smp.hh"
#include "thrift/server.hh"
namespace bpo = boost::program_options;
int main(int ac, char** av) {
app_template app;
app.add_options()
("thrift-port", bpo::value<uint16_t>()->defaul... |
Fix test from r346439 to also work on Windows due to path separator differences. | // RUN: rm -rf %t
// RUN: mkdir -p %t/prebuilt_modules
//
// RUN: %clang_cc1 -triple %itanium_abi_triple \
// RUN: -fmodules-ts -fprebuilt-module-path=%t/prebuilt-modules \
// RUN: -emit-module-interface -pthread -DBUILD_MODULE \
// RUN: %s -o %t/prebuilt_modules/mi... | // RUN: rm -rf %t
// RUN: mkdir -p %t/prebuilt_modules
//
// RUN: %clang_cc1 -triple %itanium_abi_triple \
// RUN: -fmodules-ts -fprebuilt-module-path=%t/prebuilt-modules \
// RUN: -emit-module-interface -pthread -DBUILD_MODULE \
// RUN: %s -o %t/prebuilt_modules/mi... |
Fix a regex error breaking tests. | // RUN: %clang -### -Wlarge-by-value-copy %s 2>&1 | FileCheck -check-prefix=LARGE_VALUE_COPY_DEFAULT %s
// LARGE_VALUE_COPY_DEFAULT: -Wlarge-by-value-copy=64
// RUN: %clang -### -Wlarge-by-value-copy=128 %s 2>&1 | FileCheck -check-prefix=LARGE_VALUE_COPY_JOINED %s
// LARGE_VALUE_COPY_JOINED: -Wlarge-by-value-copy=128
... | // RUN: %clang -### -Wlarge-by-value-copy %s 2>&1 | FileCheck -check-prefix=LARGE_VALUE_COPY_DEFAULT %s
// LARGE_VALUE_COPY_DEFAULT: -Wlarge-by-value-copy=64
// RUN: %clang -### -Wlarge-by-value-copy=128 %s 2>&1 | FileCheck -check-prefix=LARGE_VALUE_COPY_JOINED %s
// LARGE_VALUE_COPY_JOINED: -Wlarge-by-value-copy=128
... |
Fix SecRandomCopyBytes call with older OS X SDKs | /*
* Darwin SecRandomCopyBytes EntropySource
* (C) 2015 Daniel Seither (Kullo GmbH)
*
* Botan is released under the Simplified BSD License (see license.txt)
*/
#include <botan/internal/darwin_secrandom.h>
#include <Security/Security.h>
namespace Botan {
/**
* Gather entropy from SecRandomCopyBytes
*/
void Darwin_Sec... | /*
* Darwin SecRandomCopyBytes EntropySource
* (C) 2015 Daniel Seither (Kullo GmbH)
*
* Botan is released under the Simplified BSD License (see license.txt)
*/
#include <botan/internal/darwin_secrandom.h>
#include <Security/Security.h>
#include <Security/SecRandom.h>
namespace Botan {
/**
* Gather entropy from SecRa... |
Update clock delay for new 8-cycle instruction | #include "common.th"
_start:
bare_metal_init()
prologue
top:
d <- [rel(min0)]
e <- [rel(min1)]
f <- [rel(sec0)]
g <- [rel(sec1)]
h <- d << 4 + e
h <- h << 4 + f
h <- h << 4 + g
h -> [0x100]
c <- 1
call(sleep)
g <- g + 1
h <- g == 10
g <- g &~ h
f <- f... | #include "common.th"
_start:
bare_metal_init()
prologue
top:
d <- [rel(min0)]
e <- [rel(min1)]
f <- [rel(sec0)]
g <- [rel(sec1)]
h <- d << 4 + e
h <- h << 4 + f
h <- h << 4 + g
h -> [0x100]
c <- 1
call(sleep)
g <- g + 1
h <- g == 10
g <- g &~ h
f <- f... |
Use windows native look and feel | #include "MainWindow.h"
#include "SpritePackerProjectFile.h"
#include <QApplication>
int commandLine(QCoreApplication& app);
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
#ifdef Q_OS_WIN32
QApplication::setStyle(QStyleFactory::create("Fusion"));
#endif
QCoreApplication::setOrganiza... | #include "MainWindow.h"
#include "SpritePackerProjectFile.h"
#include <QApplication>
int commandLine(QCoreApplication& app);
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QCoreApplication::setOrganizationName("amakaseev");
QCoreApplication::setOrganizationDomain("spicyminds-lab.com");
... |
Fix capacity check in BufAccessor test | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
#include <quic/common/BufAccessor.h>
#include <folly/portability/GTest.h>
namespace quic {
TEST(SimpleBufAccessor, BasicAccess)... | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
#include <quic/common/BufAccessor.h>
#include <folly/portability/GTest.h>
namespace quic {
TEST(SimpleBufAccessor, BasicAccess)... |
Include config.h instead of windows.h in shared library test project. | #include <QtGui>
#include <sequanto/automation.h>
#include <sequanto/tree.h>
#include <sequanto/QtWrapper.h>
#include "../cxx/src/cxx_root.h"
#include <windows.h>
using namespace sequanto::automation;
int main ( int argc, char * argv[] )
{
SQServer server;
sq_init ();
sq_server_init ... | #include <QtGui>
#include <sequanto/automation.h>
#include <sequanto/tree.h>
#include <sequanto/QtWrapper.h>
#include "../cxx/src/cxx_root.h"
#include "config.h"
using namespace sequanto::automation;
int main ( int argc, char * argv[] )
{
SQServer server;
sq_init ();
sq_server_init ( &... |
Mark ExtensionApiTest.Popup as FLAKY, it is still flaky. | // Copyright (c) 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 "base/command_line.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/common/chrome_switches.h"
IN_PROC_BROWSER_T... | // Copyright (c) 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 "base/command_line.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/common/chrome_switches.h"
// Flaky, http://c... |
Rewrite c-string copy helper function cleanly | #include "insect/records.h"
static void
__record(Record *);
#include <assert.h>
#include <stdlib.h>
#include <string.h>
static void
__path_copy(RecordPath path, RecordPath *ref)
{
int len = strnlen(path, RECORD_PATH_MAX);
assert(ref);
*ref = malloc(len + 1);
assert(*ref);
(void) strncpy(*ref, path, len + 1);
}... | #include "insect/records.h"
static void
__record(Record *);
static void
__path_copy(Path, Path *);
/* FIMXE(teh): ^ inline? */
#include <assert.h>
#include <stdlib.h>
Record *
record_new(Path path)
{
Record *record;
assert(path);
record = malloc(sizeof(Record));
assert(record);
record->hits = 1;
record->path... |
Use a little type deduction | #include <functional>
#include <boost/optional.hpp>
#include "key_aliases.hh"
#include "file_contents.hh"
#include "contents.hh"
#include "mode.hh"
#include "show_message.hh"
std::map < char, std::function < void (contents&, boost::optional<int>) > >
global_normal_map,
global_insert_map;
mode::mode(const std... | #include <functional>
#include <boost/optional.hpp>
#include "key_aliases.hh"
#include "file_contents.hh"
#include "contents.hh"
#include "mode.hh"
#include "show_message.hh"
std::map < char, std::function < void (contents&, boost::optional<int>) > >
global_normal_map,
global_insert_map;
mode::mode(const std... |
Add statement to show kernel |
#include <mlopen/hipoc_kernel.hpp>
#include <mlopen/errors.hpp>
namespace mlopen {
void HIPOCKernelInvoke::run(void* args, std::size_t size) const
{
hipEvent_t start = nullptr;
hipEvent_t stop = nullptr;
void *config[] = {
HIP_LAUNCH_PARAM_BUFFER_POINTER, args,
HIP_LAUNCH_PARAM_BUFFER_SIZ... |
#include <mlopen/hipoc_kernel.hpp>
#include <mlopen/errors.hpp>
namespace mlopen {
void HIPOCKernelInvoke::run(void* args, std::size_t size) const
{
hipEvent_t start = nullptr;
hipEvent_t stop = nullptr;
void *config[] = {
HIP_LAUNCH_PARAM_BUFFER_POINTER, args,
HIP_LAUNCH_PARAM_BUFFER_SIZ... |
Include "scale" parameter in calculations | //
// Created by dar on 2/11/16.
//
#include <gui/GuiText.h>
#include "TextManager.h"
TextManager::TextManager() : GuiElementRender() {
this->charRender = new CharRender();
}
TextManager::~TextManager() {
delete this->charRender;
}
void TextManager::render(const GuiElement *const element, glm::mat4 projecti... | //
// Created by dar on 2/11/16.
//
#include <gui/GuiText.h>
#include "TextManager.h"
TextManager::TextManager() : GuiElementRender() {
this->charRender = new CharRender();
}
TextManager::~TextManager() {
delete this->charRender;
}
void TextManager::render(const GuiElement *const element, glm::mat4 projecti... |
Send more bytes per batch over serial. | #ifdef CHIPKIT
#include "serialutil.h"
#include "buffers.h"
#include "log.h"
void readFromSerial(SerialDevice* serial, bool (*callback)(uint8_t*)) {
int bytesAvailable = serial->device->available();
if(bytesAvailable > 0) {
for(int i = 0; i < bytesAvailable && !queue_full(&serial->receiveQueue);
... | #ifdef CHIPKIT
#include "serialutil.h"
#include "buffers.h"
#include "log.h"
void readFromSerial(SerialDevice* serial, bool (*callback)(uint8_t*)) {
int bytesAvailable = serial->device->available();
if(bytesAvailable > 0) {
for(int i = 0; i < bytesAvailable && !queue_full(&serial->receiveQueue);
... |
Remove comment from coroutines test, NFC | // test/SemaCXX/coroutine-traits-undefined-template.cpp
// This file contains references to sections of the Coroutines TS, which can be
// found at http://wg21.link/coroutines.
// RUN: %clang_cc1 -std=c++14 -fcoroutines-ts -verify %s -fcxx-exceptions -fexceptions -Wunused-result
namespace std {
namespace experimenta... | // This file contains references to sections of the Coroutines TS, which can be
// found at http://wg21.link/coroutines.
// RUN: %clang_cc1 -std=c++14 -fcoroutines-ts -verify %s -fcxx-exceptions -fexceptions -Wunused-result
namespace std {
namespace experimental {
template<typename ...T>
struct coroutine_traits {
... |
Add 'std' prefix for printf() in blackbox::configure test | /****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qbs.
**
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use th... | /****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qbs.
**
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use th... |
Update LinkList test2 (locate and traverse) | ///////////////////////////////////////
/// file: linklist_test.cpp
///////////////////////////////////////
#include <iostream>
#include "linklist.h"
using namespace std;
///
/// 打印链表
///
template<typename T>
void PrintList(LinkList<T> L)
{
cout << "(";
auto p = L->next;
while(p) {
cout << " " << ... | ///////////////////////////////////////
/// file: linklist_test2.cpp
///////////////////////////////////////
#include <iostream>
#include "linklist.h"
using namespace std;
///
/// 打印链表
///
template<typename T>
void PrintList(LinkList<T> L)
{
cout << "(";
auto p = L->next;
while(p) {
cout << " " <<... |
Fix layout issue in details window | #include "viewer/details-window.h"
#include <QLabel>
#include <ui_details-window.h>
#include "helpers.h"
#include "models/image.h"
DetailsWindow::DetailsWindow(Profile *profile, QWidget *parent)
: QDialog(parent), ui(new Ui::DetailsWindow), m_profile(profile)
{
ui->setupUi(this);
}
DetailsWindow::~DetailsWindow()
... | #include "viewer/details-window.h"
#include <QLabel>
#include <ui_details-window.h>
#include "helpers.h"
#include "models/image.h"
DetailsWindow::DetailsWindow(Profile *profile, QWidget *parent)
: QDialog(parent), ui(new Ui::DetailsWindow), m_profile(profile)
{
ui->setupUi(this);
}
DetailsWindow::~DetailsWindow()
... |
Add code for function test. | #include <vector>
#include <string>
std::string createString(){
std::string hi("Hello world!");
return hi;
}
std::vector<std::string> createVector(){
std::vector<std::string> my_vector;
my_vector.push_back(createString());
my_vector.push_back(createString());
my_vector.push_back(createString());
return my_vect... | #include <vector>
#include <string>
std::string createString(){
std::string hi("Hello world!");
return hi;
}
std::vector<std::string> createVector(){
std::vector<std::string> my_vector;
my_vector.push_back(createString());
my_vector.push_back(createString());
my_vector.push_back(createString());
return my_vect... |
Put the symbol requester func into the proper namespace! | // request symbols
#include "cling/Interpreter/Interpreter.h"
#include "cling/Interpreter/CValuePrinter.h"
#include "cling/Interpreter/DynamicExprInfo.h"
#include "cling/Interpreter/InterpreterCallbacks.h"
#include "cling/Interpreter/LookupHelper.h"
#include "cling/Interpreter/ValuePrinter.h"
#include "cling/Interprete... | // request symbols
#include "cling/Interpreter/Interpreter.h"
#include "cling/Interpreter/CValuePrinter.h"
#include "cling/Interpreter/DynamicExprInfo.h"
#include "cling/Interpreter/InterpreterCallbacks.h"
#include "cling/Interpreter/LookupHelper.h"
#include "cling/Interpreter/ValuePrinter.h"
#include "cling/Interprete... |
Handle CAN interrupts on LPC. | #ifdef __LPC17XX__
#include "canread.h"
CanMessage receiveCanMessage(CanBus* bus) {
CAN_MSG_Type message;
CAN_ReceiveMsg(bus->controller, &message);
CanMessage result = {message.id, 0};
result.data = message.dataA[0];
result.data |= (message.dataA[1] << 8);
result.data |= (message.dataA[2] <<... | #ifdef __LPC17XX__
#include "canread.h"
#include "signals.h"
extern "C" {
void CAN_IRQHandler() {
if((CAN_IntGetStatus(LPC_CAN1) & 0x01) == 1) {
getCanBuses()[0].messageReceived = true;
} else if((CAN_IntGetStatus(LPC_CAN2) & 0x01) == 1) {
getCanBuses()[1].messageReceived = true;
}
}
}
... |
Remove usage of broken move constructor | #include <iostream>
#include <array>
#include <asio/steady_timer.hpp>
#include <asio.hpp>
#include <thread>
#include "node/raft_node.h"
using namespace std;
std::vector<raft_node_endpoint_t> peers{
{1ul, "localhost", 12345, 13001},
{2ul, "localhost", 12346, 13002},
{3ul, "localhost", 12347, 13... | #include <iostream>
#include <array>
#include <asio/steady_timer.hpp>
#include <asio.hpp>
#include <thread>
#include "node/raft_node.h"
using namespace std;
std::vector<raft_node_endpoint_t> peers{
{1ul, "localhost", 12345, 13001},
{2ul, "localhost", 12346, 13002},
{3ul, "localhost", 12347, 13... |
Make planning respect world frame velocity | #include "planning/jet/filter_sim.hh"
#include "eigen_helpers.hh"
namespace planning {
namespace jet {
estimation::jet_filter::State kf_state_from_xlqr_state(const State& x,
const Controls& u,
const Paramete... | #include "planning/jet/filter_sim.hh"
#include "eigen_helpers.hh"
namespace planning {
namespace jet {
estimation::jet_filter::State kf_state_from_xlqr_state(const State& x,
const Controls& u,
const Paramete... |
Fix changes where the default value was always being returned for many of the robot state status functions. | #include "RobotState.h"
RobotStateInterface* RobotState::impl = 0;
void RobotState::SetImplementation(RobotStateInterface* i) {
impl = i;
}
bool RobotState::IsDisabled() {
if (impl != 0) {
return impl->IsDisabled();
}
return true;
}
bool RobotState::IsEnabled() {
if (impl != 0) {
... | #include "RobotState.h"
RobotStateInterface* RobotState::impl = 0;
void RobotState::SetImplementation(RobotStateInterface* i) {
impl = i;
}
bool RobotState::IsDisabled() {
if (impl != 0) {
return impl->IsDisabled();
}
return true;
}
bool RobotState::IsEnabled() {
if (impl != 0) {
... |
Make sure the pointer in PageData::html remains valid while PageData is called. | // Copyright (c) 2008-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 "chrome/browser/history/history_publisher.h"
#include "base/utf_string_conversions.h"
namespace history {
const char* const HistoryPu... | // Copyright (c) 2008-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 "chrome/browser/history/history_publisher.h"
#include "base/utf_string_conversions.h"
namespace history {
const char* const HistoryPu... |
Edit the validate multiple reads sample | // Validate multiple reads
#include <sstream>
#include <string>
int main()
{
std::istringstream stream{"John Smith 32"};
std::string first_name;
std::string family_name;
int age;
if (stream >> first_name &&
stream >> family_name &&
stream >> age) {
// Use values
}
}
// Validate reading multiple v... | // Validate multiple reads
#include <sstream>
#include <string>
int main()
{
std::istringstream stream{"John Smith 32"};
std::string first_name;
std::string family_name;
int age;
if (stream >> first_name &&
stream >> family_name &&
stream >> age) {
// Use values
}
}
// Ensure that multiple stream... |
Add oriented tests for facingNorth |
#include <gtest/gtest.h>
#include "../c_oriented.h"
#include "../c_moveable.h"
using aronnax::Vector2d;
using spacegun::Moveable;
using spacegun::Oriented;
class OrientedTest : public testing::Test {
protected:
virtual void SetUp() {
expectedAngle_ = 15.0;
moveable_ = new Moveable(Vector2d(), Vec... |
#include <gtest/gtest.h>
#include "../c_oriented.h"
#include "../c_moveable.h"
using aronnax::Vector2d;
using spacegun::Moveable;
using spacegun::Oriented;
class OrientedTest : public testing::Test {
protected:
virtual void SetUp() {
expectedAngle_ = 15.0;
moveable_ = new Moveable(Vector2d(), Vec... |
Update init writing to universal init | /******************************************************
* This is CIR-KIT 3rd robot control driver.
* Author : Arita Yuta(Kyutech)
******************************************************/
#include "cirkit_unit03_driver.hpp"
#include <string>
#include <utility>
int main(int argc, char** argv)
{
ros::init(argc, arg... | /******************************************************
* This is CIR-KIT 3rd robot control driver.
* Author : Arita Yuta(Kyutech)
******************************************************/
#include "cirkit_unit03_driver.hpp"
#include <string>
#include <utility>
int main(int argc, char** argv)
{
ros::init(argc, arg... |
ADD print the saved data to the save file | #include "Progression.h"
Progression* Progression::m_instance = nullptr;
Progression::Progression()
{
this->m_currentLevel = 0;
this->m_currentCheckpoint = 0;
this->m_unlockedLevels = 0;
}
Progression::~Progression()
{
}
bool Progression::WriteToFile(std::string filename)
{
std::ofstream saveFile;
saveFile.o... | #include "Progression.h"
Progression* Progression::m_instance = nullptr;
Progression::Progression()
{
this->m_currentLevel = 0;
this->m_currentCheckpoint = 0;
this->m_unlockedLevels = 0;
}
Progression::~Progression()
{
}
bool Progression::WriteToFile(std::string filename)
{
std::ofstream saveFile;
saveFile.o... |
Change 4 spaces to tab | #include <iostream>
#include "list.h"
int List::numberOfNodes = 0;
void List::addToHead(int value) {
node *temp=new node;
temp->data=value;
temp->next=head;
head=temp;
numberOfNodes++;
}
void List::addToTail(int value) {
node *temp = new node;
temp->data = value;
temp->next = NULL;
if(head == NU... | #include <iostream>
#include "list.h"
int List::numberOfNodes = 0;
void List::addToHead(int value) {
node *temp=new node;
temp->data=value;
temp->next=head;
head=temp;
numberOfNodes++;
}
void List::addToTail(int value) {
node *temp = new node;
temp->data = value;
temp->next = NULL;
if(head == NULL)... |
Add constexpr keyword to inline inited variable | #include <Ab/Config.hpp>
#include <Ab/Memory.hpp>
namespace Ab {
const MemoryConfig Memory::defaultConfig_;
} // namespace Ab
| #include <Ab/Config.hpp>
#include <Ab/Memory.hpp>
namespace Ab {
constexpr const MemoryConfig Memory::defaultConfig_;
} // namespace Ab
|
Add a trivial write only GLSL test. | #include <Halide.h>
#include <stdio.h>
#include <stdlib.h>
using namespace Halide;
int main() {
// This test must be run with an OpenGL target
const Target &target = get_jit_target_from_environment();
if (!target.has_feature(Target::OpenGL)) {
fprintf(stderr,"ERROR: This test must be run with an ... | #include <Halide.h>
#include <stdio.h>
#include <stdlib.h>
using namespace Halide;
int main() {
// This test must be run with an OpenGL target
const Target &target = get_jit_target_from_environment();
if (!target.has_feature(Target::OpenGL)) {
fprintf(stderr,"ERROR: This test must be run with an ... |
Return code of driver program now non-zero on error. | /**
* @file
*
* The driver program.
*/
#include "bi/build/Driver.hpp"
#include "bi/exception/DriverException.hpp"
#include "bi/build/misc.hpp"
#include <iostream>
int main(int argc, char** argv) {
using namespace bi;
try {
/* first option (should be a program name) */
std::string prog;
if (argc > ... | /**
* @file
*
* The driver program.
*/
#include "bi/build/Driver.hpp"
#include "bi/exception/DriverException.hpp"
#include "bi/build/misc.hpp"
#include <iostream>
int main(int argc, char** argv) {
using namespace bi;
try {
/* first option (should be a program name) */
std::string prog;
if (argc > ... |
Fix the windows allocator to behave properly on realloc. | // Copyright (c) 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.
// This is a simple allocator based on the windows heap.
extern "C" {
HANDLE win_heap;
bool win_heap_init(bool use_lfh) {
win_heap = HeapCreate(0... | // Copyright (c) 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.
// This is a simple allocator based on the windows heap.
extern "C" {
HANDLE win_heap;
bool win_heap_init(bool use_lfh) {
win_heap = HeapCreate(0... |
Put fast legality checks first | #include "Moves/Queenside_Castle.h"
#include "Moves/Move.h"
#include "Game/Board.h"
#include "Pieces/Piece.h"
Queenside_Castle::Queenside_Castle() : Move(-2, 0)
{
}
bool Queenside_Castle::move_specific_legal(const Board& board, char file_start, int rank_start) const
{
return ! board.piece_has_moved(file_star... | #include "Moves/Queenside_Castle.h"
#include "Moves/Move.h"
#include "Game/Board.h"
#include "Pieces/Piece.h"
Queenside_Castle::Queenside_Castle() : Move(-2, 0)
{
}
bool Queenside_Castle::move_specific_legal(const Board& board, char file_start, int rank_start) const
{
return ! board.piece_has_moved(file_star... |
Add quick test for logging worker. | /*
@ 0xCCCCCCCC
*/
int main()
{
return 0;
} | /*
@ 0xCCCCCCCC
*/
#include <conio.h>
#include <random>
#include <sstream>
#include "klog/klog_worker.h"
void WorkerTest()
{
klog::LogWorker worker(std::wstring(L"test.log"), std::chrono::seconds(3));
std::random_device rd;
std::default_random_engine engine(rd());
std::uniform_int_distribution<> di... |
Fix normal calculation for scaled spheres. | #include "./ShapeSphere.hpp"
#include "math/misc.hpp"
#include "math/Sphere.hpp"
#include <cmath>
using namespace yks;
Optional<float> ShapeSphere::hasIntersection(const Ray& r) const {
const Ray local_ray = transform.localFromParent * r;
return intersect_with_sphere(vec3_0, 1.0f, local_ray);
}
Optional<Intersecti... | #include "./ShapeSphere.hpp"
#include "math/misc.hpp"
#include "math/Sphere.hpp"
#include <cmath>
using namespace yks;
Optional<float> ShapeSphere::hasIntersection(const Ray& r) const {
const Ray local_ray = transform.localFromParent * r;
return intersect_with_sphere(vec3_0, 1.0f, local_ray);
}
Optional<Intersecti... |
Modify Level tests to focus on boundaries. | #include <stdexcept>
#include "gtest/gtest.h"
#include "map/Level.h"
#include "map/Tile.h"
TEST(LevelTest, DefaultLevelIsWalls)
{
Level l1(10, 10);
EXPECT_EQ(WallTile, l1.getTile(5, 5));
}
TEST(LevelTest, LevelGetTile)
{
Level l1(10, 10);
EXPECT_NO_THROW(l1.getTile(5, 5));
EXPECT_THROW(l1.getTile(50, 50), std... | #include <stdexcept>
#include "gtest/gtest.h"
#include "map/Level.h"
#include "map/Tile.h"
TEST(LevelTest, DefaultLevelIsWalls)
{
Level l1(10, 10);
EXPECT_EQ(WallTile, l1.getTile(5, 5));
}
TEST(LevelTest, LevelGetTile)
{
Level l1(10, 10);
EXPECT_NO_THROW(l1.getTile(9, 9));
EXPECT_THROW(l1.getTile(10, 10), std... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.