Skip to content

Instantly share code, notes, and snippets.

View blogdarkspot's full-sized avatar
🏠
Working from home

Fábio Santana blogdarkspot

🏠
Working from home
View GitHub Profile
#include <iostream>
#include <memory>
struct Base : public std::enable_shared_from_this<Base>
{
int a;
virtual void f() const { std::cout << "I am base!\n"; }
virtual ~Base() {}
};
//python file.py
#-*- coding: utf-8 -*-
import json
with open('settings.json') as setting_file:
settings = json.load(setting_file)
containers = settings['containers']
#include <stdio.h>
int main(){
int a[10],b[10],i,j,f;
// receber vetor a
for (i=0;i<10;i++){
printf("digite o valor de %d:",i+1);
scanf("%d",&a[i]);
}
// zerar vetor b
1>------ Build started: Project: gtest, Configuration: Release Win32 ------
1>gtest-all.cc
1>gtest.vcxproj -> D:\Lng\googletest\googletest\msvc\gtest/Release\gtest.lib
2>------ Build started: Project: gtest_main, Configuration: Release Win32 ------
2>gtest_main.cc
2>gtest_main.vcxproj -> D:\Lng\googletest\googletest\msvc\gtest/Release\gtest_main.lib
3>------ Build started: Project: gtest_unittest, Configuration: Release Win32 ------
4>------ Build started: Project: gtest_prod_test, Configuration: Release Win32 ------
3>gtest_unittest.cc
4>gtest_prod_test.cc
class ActiveMQManagerFake : public ActiveMQManagerInterface {
private:
ActiveMQManagerInterface* mock;
public:
void setMock(ActiveMQManagerInterface* mock) {
if (mock != NULL) {
this->mock = mock;
}
}
class ActiveMQManagerInterface
{
public:
virtual void connectToServer() = 0;
virtual void sendMessageToServer() = 0;
virtual bool isConnected() = 0;
virtual bool start() = 0;
virtual bool stop() = 0;
using ::testing::_;
using ::testing::Invoke;
class Foo {
public:
virtual ~Foo() {}
virtual char DoThis(int n) = 0;
virtual void DoThat(const char* s, int* p) = 0;
};
Service *pService = NULL;
DECLSPEC bool StartDLL()
{
bool ret = true;
if(!pService)
{
if(!(pService = Service::getInstance()))
{
ret = false;
#ifndef __ENTRYPOINT_H_
#define __ENTRYPOINT_H_
extern "C"
{
DECLSPEC bool StartDLL();
DECLSPEC bool StopDLL();
DECLSPEC bool InjectMock(void *mock);
}
#endif