Skip to content
Snippets Groups Projects
Commit acec5b81 authored by Sergey Yakubov's avatar Sergey Yakubov
Browse files

set tab sizes back to 4

parent 5c5b866a
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@ if(ASTYLE_EXECUTABLE)
COMMAND
${ASTYLE_EXECUTABLE} -i
--exclude=${PROJECT_BINARY_DIR}
--recursive -n --style=google --indent=spaces=2
--recursive -n --style=google --indent=spaces=4
"${PROJECT_SOURCE_DIR}/*.cpp" "${PROJECT_SOURCE_DIR}/*.h"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
VERBATIM
......
......@@ -6,37 +6,37 @@
namespace HIDRA2 {
enum OP_CODE : uint8_t {
OP_CODE__HELLO,
OP_CODE__HELLO,
};
enum ERROR_CODE : uint16_t {
ERR__NO_ERROR,
ERR__UNSUPPORTED_VERSION,
ERR__INTERNAL_SERVER_ERROR = 65535,
ERR__NO_ERROR,
ERR__UNSUPPORTED_VERSION,
ERR__INTERNAL_SERVER_ERROR = 65535,
};
struct NetworkRequest {
OP_CODE op_code;
uint64_t request_id;
char data[];
OP_CODE op_code;
uint64_t request_id;
char data[];
};
struct NetworkResponse {
OP_CODE op_code;
uint64_t request_id;
ERROR_CODE error_code;
char data[];
OP_CODE op_code;
uint64_t request_id;
ERROR_CODE error_code;
char data[];
};
struct OP_HelloRequest {
uint32_t client_version;
uint32_t client_version;
OS_TYPE os : 4;
bool is_x64 : 1;
OS_TYPE os : 4;
bool is_x64 : 1;
};
struct OP_HelloResponse {
uint32_t server_version;
uint32_t server_version;
};
}
......
......@@ -5,11 +5,11 @@
namespace HIDRA2 {
enum OS_TYPE : uint8_t {
OS_UNKOWN,
OS_LINUX,
OS_WINDOWS,
OS_UNKOWN,
OS_LINUX,
OS_WINDOWS,
OS_INVALID = 16, /* Never use more then 4 bit */
OS_INVALID = 16, /* Never use more then 4 bit */
};
}
......
#include <gtest/gtest.h>
TEST(EMPTY, REMOVEME) {
EXPECT_EQ(1, 1);
EXPECT_EQ(1, 1);
}
......@@ -5,16 +5,16 @@
namespace HIDRA2 {
class Producer {
private:
static unsigned long kinit_count_;
Producer();
public:
static const uint32_t VERSION;
private:
static unsigned long kinit_count_;
Producer();
public:
static const uint32_t VERSION;
Producer(const Producer&) = delete;
Producer& operator=(const Producer&) = delete;
Producer(const Producer&) = delete;
Producer& operator=(const Producer&) = delete;
static Producer* CreateProducer(std::string receiver_address);
static Producer* CreateProducer(std::string receiver_address);
};
}
......
......@@ -4,9 +4,9 @@ unsigned long HIDRA2::Producer::kinit_count_ = 0;
const uint32_t HIDRA2::Producer::VERSION = 1;
HIDRA2::Producer::Producer() {
kinit_count_++;
kinit_count_++;
}
HIDRA2::Producer *HIDRA2::Producer::CreateProducer(std::string receiver_address) {
return new Producer();
return new Producer();
}
......@@ -3,11 +3,11 @@
namespace {
TEST(VERSION, VersionAboveZero) {
EXPECT_GE(HIDRA2::Producer::VERSION, 0);
EXPECT_GE(HIDRA2::Producer::VERSION, 0);
}
TEST(CreateProducer, PointerIsNotNullptr) {
HIDRA2::Producer* prod = HIDRA2::Producer::CreateProducer("127.0.0.1");
EXPECT_NE(prod, nullptr);
HIDRA2::Producer* prod = HIDRA2::Producer::CreateProducer("127.0.0.1");
EXPECT_NE(prod, nullptr);
}
}
......@@ -2,15 +2,15 @@
#include <iostream>
int main (int argc, char* argv[]) {
std::cout << "Running producer version: " << HIDRA2::Producer::VERSION << std::endl;
std::cout << "Running producer version: " << HIDRA2::Producer::VERSION << std::endl;
HIDRA2::Producer* producer = HIDRA2::Producer::CreateProducer("127.0.0.1");
if(!producer) {
std::cerr << "Fail to create producer" << std::endl;
return 1;
}
HIDRA2::Producer* producer = HIDRA2::Producer::CreateProducer("127.0.0.1");
if(!producer) {
std::cerr << "Fail to create producer" << std::endl;
return 1;
}
std::cout << "Successfully create producer " << std::hex << producer << std::endl;
std::cout << "Successfully create producer " << std::hex << producer << std::endl;
return 0;
return 0;
}
#include <gtest/gtest.h>
TEST(EMPTY, REMOVEME) {
EXPECT_EQ(1, 1);
EXPECT_EQ(1, 1);
}
......@@ -3,7 +3,7 @@
namespace {
TEST(WorkerAPI, TestName) {
SUCCEED();
SUCCEED();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment