From 067eb60377b02cc2b8dfbbeee3fd6deab6fd5b88 Mon Sep 17 00:00:00 2001 From: vinit Date: Fri, 7 May 2021 11:28:08 +0200 Subject: [PATCH 1/5] modified version in conanfile.py --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index 976c9e0..ac54b31 100644 --- a/conanfile.py +++ b/conanfile.py @@ -3,7 +3,7 @@ class CircularBufferConan(ConanFile): name = "circular_buffer" - version = "0.0.1" + version = "0.1.0" license = "MIT License" author = "vinit james vinit.james24@gmail.com" url = "https://github.com/vinitjames/circularbuffer" From 19703d6e801354a6927525c03e3044801a029a09 Mon Sep 17 00:00:00 2001 From: vinit Date: Tue, 11 May 2021 16:44:24 +0200 Subject: [PATCH 2/5] added test with std::copy function --- tests/iterator_test.cpp | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/tests/iterator_test.cpp b/tests/iterator_test.cpp index 356e540..4fa0d3a 100644 --- a/tests/iterator_test.cpp +++ b/tests/iterator_test.cpp @@ -5,7 +5,7 @@ #include "gtest/gtest.h" #define TEST_BUFFER_SIZE 100 -#define REDUCE_SIZE 100 +#define REDUCE_SIZE 50 class CircularBufferTest : public ::testing::Test{ @@ -70,10 +70,9 @@ TEST_F(CircularBufferTest, RangeBasedLoopTest){ //check iterators after modifications for(int i = 0; i buffer_copy; + buffer_copy.reserve(test_str_buff.size()); + std::copy(test_str_buff.begin(), test_str_buff.end(), std::back_inserter(buffer_copy)); + int i = 0; + for(const auto& elem: test_str_buff) + EXPECT_EQ(elem, buffer_copy[i++]); + buffer_copy.clear(); + //remove elements from buffer + for(int i=0; i Date: Tue, 10 May 2022 16:26:10 +0200 Subject: [PATCH 3/5] changed goggle test version --- tests/CMakeLists.txt.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt.in b/tests/CMakeLists.txt.in index 0385d1e..74f4aed 100644 --- a/tests/CMakeLists.txt.in +++ b/tests/CMakeLists.txt.in @@ -5,7 +5,7 @@ project(googletest-download NONE) include(ExternalProject) ExternalProject_Add(googletest GIT_REPOSITORY https://github.com/google/googletest.git - GIT_TAG master + GIT_TAG release-1.8.0 SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-src" BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-build" CONFIGURE_COMMAND "" From 48ba3d664403bf8e0d50f56b80be10478f553fbd Mon Sep 17 00:00:00 2001 From: Iskandar Safarov Date: Mon, 19 Jun 2023 12:42:05 +1000 Subject: [PATCH 4/5] Exposed value_type for std::back_inserter support --- circular_buffer.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/circular_buffer.h b/circular_buffer.h index a60926f..0c3beec 100644 --- a/circular_buffer.h +++ b/circular_buffer.h @@ -13,7 +13,6 @@ template class CircularBuffer { private: - typedef T value_type; typedef T* pointer; typedef const T* const_pointer; typedef T& reference; @@ -24,6 +23,8 @@ class CircularBuffer { public: + typedef T value_type; + explicit CircularBuffer(size_t size) :_buff{std::unique_ptr(new value_type[size])}, _max_size{size}{} From f76e51b08eacc13c02786ba8e25ac1f0f6f1f8c7 Mon Sep 17 00:00:00 2001 From: Iskandar Safarov Date: Mon, 19 Jun 2023 12:47:45 +1000 Subject: [PATCH 5/5] Added CI tests for PR --- .github/workflows/circularbuffer_build_pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/circularbuffer_build_pipeline.yml b/.github/workflows/circularbuffer_build_pipeline.yml index 6083e3e..fb19c4c 100644 --- a/.github/workflows/circularbuffer_build_pipeline.yml +++ b/.github/workflows/circularbuffer_build_pipeline.yml @@ -1,6 +1,6 @@ name: Build and Test -on: [push] +on: [push, pull_request] env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)