Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/mac-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ jobs:
distribution: 'temurin'
java-version: '17'
architecture: x64
# - name: run-cppcheck
# run: |
# brew install cppcheck
# sh run_cppcheck.sh
# - name: upload-cppcheck-results
# if: failure()
# uses: actions/upload-artifact@v2
# with:
# name: cppcheck-results
# path: cppcheck-results.log
- name: run-cppcheck
run: |
brew install cppcheck
sh run_cppcheck.sh
- name: upload-cppcheck-results
if: failure()
uses: actions/upload-artifact@v2
with:
name: cppcheck-results
path: cppcheck-results.log
- name: Extract key-pair into file
run: |
mkdir ~/certs
Expand Down
33 changes: 31 additions & 2 deletions .github/workflows/win-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,22 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2

- name: setup-cppcheck
id: setup_cppcheck
run: |
choco install cppcheck -y
echo "C:\Program Files\Cppcheck" >> $env:GITHUB_PATH

- name: run-cppcheck
id: run-cppcheck
run: |
.\run_cppcheck.ps1
- name: upload-cppcheck-results
if: failure()
uses: actions/upload-artifact@v2
with:
name: cppcheck-results
path: cppcheck-results.log
- name: Get Java distribution
uses: actions/setup-java@v2
with:
Expand Down Expand Up @@ -118,7 +133,21 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2

- name: run-cppcheck
id: setup_cppcheck
run: |
choco install cppcheck -y
echo "C:\Program Files\Cppcheck" >> $env:GITHUB_PATH
- name: run-cppcheck
id: run-cppcheck
run: |
.\run_cppcheck.ps1
- name: upload-cppcheck-results
if: failure()
uses: actions/upload-artifact@v2
with:
name: cppcheck-results
path: cppcheck-results.log
- name: Get Java distribution
uses: actions/setup-java@v2
with:
Expand Down
11 changes: 11 additions & 0 deletions documentdb.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<def format="2">
<!-- Boost Library Configuration -->
<!-- Documentation: https://www.boost.org/doc/libs/ -->
<!-- ########## Boost defines / macros ########## -->
<define name="IGNITE_BINARY_TYPE_START(T)" value=""/>
<define name="IGNITE_BINARY_GET_TYPE_NAME_AS_IS(typeName)" value=""/>
<define name="IGNITE_BINARY_GET_FIELD_ID_AS_HASH" value=""/>
<define name="IGNITE_BINARY_IS_NULL_FALSE(T)" value=""/>
<define name="IGNITE_BINARY_GET_NULL_DEFAULT_CTOR(T)" value=""/>
</def>
19 changes: 0 additions & 19 deletions run_cppcheck.bat

This file was deleted.

23 changes: 23 additions & 0 deletions run_cppcheck.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#
# Copyright 2019 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license" file accompanying this file. This file is distributed
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
#

# --force: force checks all define combinations (default max is 12)
# --suppress=objectIndex: seemingly false-positive

cppcheck --force --library=boost --library=documentdb .\src\ 2> .\cppcheck-results.log
If ((Get-Content "cppcheck-results.log") -eq $Null) {
exit 0
}
exit 1
5 changes: 2 additions & 3 deletions run_cppcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ RESULTS_FILE=cppcheck-results.log

# --force: force checks all define combinations (default max is 12)
# -iaws-sdk-cpp: avoid checking AWS C++ SDK source files in our repo
# -UWIN32: do not check WIN32-defined codepaths; this would throw errors on Mac
cppcheck --force -iaws-sdk-cpp -UWIN32 ./src 2> ${RESULTS_FILE}
cppcheck --force --library=boost --library=documentdb -UWIN32 ./src/ 2> ${RESULTS_FILE}

if [ -s ${RESULTS_FILE} ]; then
echo "!! Cppcheck errors found! Check ${RESULTS_FILE} for details."
exit 1
else
echo "No Cppcheck errors found."
fi
fi
10 changes: 1 addition & 9 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,10 @@ if (${WITH_TESTS})
endif()
endif()

if (${WITH_THIN_CLIENT} OR ${WITH_ODBC})
if (${WITH_ODBC})
add_subdirectory(network)
endif()

if (${WITH_THIN_CLIENT})
add_subdirectory(thin-client)

if (${WITH_TESTS} AND EXISTS ${CMAKE_SOURCE_DIR}/thin-client-test)
add_subdirectory(thin-client-test)
endif()
endif()

if (${WITH_ODBC})
add_subdirectory(odbc)

Expand Down
22 changes: 11 additions & 11 deletions src/core-test/src/compute_java_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ struct ComputeJavaTestSuiteFixture
/**
* Binarizable object for task tests.
*/
class PlatformComputeBinarizable
class JavaPlatformComputeBinarizable
{
public:
/**
* Constructor.
*/
PlatformComputeBinarizable()
JavaPlatformComputeBinarizable()
{
// No-op.
}
Expand All @@ -150,7 +150,7 @@ class PlatformComputeBinarizable
*
* @param field Field.
*/
PlatformComputeBinarizable(int32_t field) :
JavaPlatformComputeBinarizable(int32_t field) :
field(field)
{
// No-op.
Expand All @@ -166,19 +166,19 @@ namespace ignite
namespace binary
{
template<>
struct BinaryType<PlatformComputeBinarizable> : BinaryTypeDefaultAll<PlatformComputeBinarizable>
struct BinaryType<JavaPlatformComputeBinarizable> : BinaryTypeDefaultAll<JavaPlatformComputeBinarizable>
{
static void GetTypeName(std::string& dst)
{
dst = "PlatformComputeBinarizable";
dst = "JavaPlatformComputeBinarizable";
}

static void Write(BinaryWriter& writer, const PlatformComputeBinarizable& obj)
static void Write(BinaryWriter& writer, const JavaPlatformComputeBinarizable& obj)
{
writer.WriteInt32("field", obj.field);
}

static void Read(BinaryReader& reader, PlatformComputeBinarizable& dst)
static void Read(BinaryReader& reader, JavaPlatformComputeBinarizable& dst)
{
dst.field = reader.ReadInt32("field");
}
Expand Down Expand Up @@ -244,8 +244,8 @@ BOOST_AUTO_TEST_CASE(EchoTaskObject)
int32_t value = i * 42;
cache.Put(ECHO_TYPE_OBJECT, value);

PlatformComputeBinarizable res =
compute.ExecuteJavaTask<PlatformComputeBinarizable>(ECHO_TASK, ECHO_TYPE_OBJECT);
JavaPlatformComputeBinarizable res =
compute.ExecuteJavaTask<JavaPlatformComputeBinarizable>(ECHO_TASK, ECHO_TYPE_OBJECT);

BOOST_CHECK_EQUAL(value, res.field);
}
Expand All @@ -261,8 +261,8 @@ BOOST_AUTO_TEST_CASE(EchoTaskObjectAsync)
int32_t value = i * 42;
cache.Put(ECHO_TYPE_OBJECT, value);

PlatformComputeBinarizable res =
compute.ExecuteJavaTaskAsync<PlatformComputeBinarizable>(ECHO_TASK, ECHO_TYPE_OBJECT).GetValue();
JavaPlatformComputeBinarizable res =
compute.ExecuteJavaTaskAsync<JavaPlatformComputeBinarizable>(ECHO_TASK, ECHO_TYPE_OBJECT).GetValue();

BOOST_CHECK_EQUAL(value, res.field);
}
Expand Down
72 changes: 36 additions & 36 deletions src/core-test/src/dynamic_size_array_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ using namespace ignite;
using namespace ignite::common;


struct TestStruct
struct DynamicSizeArrayTestStruct
{
int32_t one;
int32_t two;

TestStruct() :
DynamicSizeArrayTestStruct() :
one(1),
two(2)
{
// No-op.
}

TestStruct(int32_t a, int32_t b) :
DynamicSizeArrayTestStruct(int32_t a, int32_t b) :
one(a),
two(b)
{
Expand Down Expand Up @@ -81,7 +81,7 @@ BOOST_AUTO_TEST_CASE(ResizeBool)

BOOST_AUTO_TEST_CASE(ResizeStruct)
{
DynamicSizeArray<TestStruct> test;
DynamicSizeArray<DynamicSizeArrayTestStruct> test;

test.Resize(16);

Expand Down Expand Up @@ -115,12 +115,12 @@ BOOST_AUTO_TEST_CASE(PushBack)

BOOST_AUTO_TEST_CASE(ResizeGrowing)
{
DynamicSizeArray<TestStruct> test;
DynamicSizeArray<DynamicSizeArrayTestStruct> test;

test.PushBack(TestStruct(3, 7));
test.PushBack(TestStruct(5, 6));
test.PushBack(TestStruct(42, 55));
test.PushBack(TestStruct(47334, 3));
test.PushBack(DynamicSizeArrayTestStruct(3, 7));
test.PushBack(DynamicSizeArrayTestStruct(5, 6));
test.PushBack(DynamicSizeArrayTestStruct(42, 55));
test.PushBack(DynamicSizeArrayTestStruct(47334, 3));

BOOST_CHECK_EQUAL(test.GetSize(), 4);

Expand All @@ -141,18 +141,18 @@ BOOST_AUTO_TEST_CASE(ResizeGrowing)
BOOST_CHECK_EQUAL(test[i].one, 1);
BOOST_CHECK_EQUAL(test[i].two, 2);

test[i] = TestStruct(i * 3, i * 32508 + i);
test[i] = DynamicSizeArrayTestStruct(i * 3, i * 32508 + i);
}
}

BOOST_AUTO_TEST_CASE(ResizeShrinking)
{
DynamicSizeArray<TestStruct> test;
DynamicSizeArray<DynamicSizeArrayTestStruct> test;

test.PushBack(TestStruct(3, 7));
test.PushBack(TestStruct(5, 6));
test.PushBack(TestStruct(42, 55));
test.PushBack(TestStruct(47334, 3));
test.PushBack(DynamicSizeArrayTestStruct(3, 7));
test.PushBack(DynamicSizeArrayTestStruct(5, 6));
test.PushBack(DynamicSizeArrayTestStruct(42, 55));
test.PushBack(DynamicSizeArrayTestStruct(47334, 3));

BOOST_CHECK_EQUAL(test.GetSize(), 4);

Expand All @@ -169,12 +169,12 @@ BOOST_AUTO_TEST_CASE(ResizeShrinking)

BOOST_AUTO_TEST_CASE(ResizeKeep)
{
DynamicSizeArray<TestStruct> test;
DynamicSizeArray<DynamicSizeArrayTestStruct> test;

test.PushBack(TestStruct(3, 7));
test.PushBack(TestStruct(5, 6));
test.PushBack(TestStruct(42, 55));
test.PushBack(TestStruct(47334, 3));
test.PushBack(DynamicSizeArrayTestStruct(3, 7));
test.PushBack(DynamicSizeArrayTestStruct(5, 6));
test.PushBack(DynamicSizeArrayTestStruct(42, 55));
test.PushBack(DynamicSizeArrayTestStruct(47334, 3));

BOOST_CHECK_EQUAL(test.GetSize(), 4);

Expand All @@ -193,12 +193,12 @@ BOOST_AUTO_TEST_CASE(ResizeKeep)

BOOST_AUTO_TEST_CASE(ReserveMore)
{
DynamicSizeArray<TestStruct> test;
DynamicSizeArray<DynamicSizeArrayTestStruct> test;

test.PushBack(TestStruct(3, 7));
test.PushBack(TestStruct(5, 6));
test.PushBack(TestStruct(42, 55));
test.PushBack(TestStruct(47334, 3));
test.PushBack(DynamicSizeArrayTestStruct(3, 7));
test.PushBack(DynamicSizeArrayTestStruct(5, 6));
test.PushBack(DynamicSizeArrayTestStruct(42, 55));
test.PushBack(DynamicSizeArrayTestStruct(47334, 3));

BOOST_CHECK_EQUAL(test.GetSize(), 4);

Expand All @@ -223,12 +223,12 @@ BOOST_AUTO_TEST_CASE(ReserveMore)

BOOST_AUTO_TEST_CASE(ReserveLess)
{
DynamicSizeArray<TestStruct> test;
DynamicSizeArray<DynamicSizeArrayTestStruct> test;

test.PushBack(TestStruct(3, 7));
test.PushBack(TestStruct(5, 6));
test.PushBack(TestStruct(42, 55));
test.PushBack(TestStruct(47334, 3));
test.PushBack(DynamicSizeArrayTestStruct(3, 7));
test.PushBack(DynamicSizeArrayTestStruct(5, 6));
test.PushBack(DynamicSizeArrayTestStruct(42, 55));
test.PushBack(DynamicSizeArrayTestStruct(47334, 3));

BOOST_CHECK_EQUAL(test.GetSize(), 4);

Expand All @@ -252,14 +252,14 @@ BOOST_AUTO_TEST_CASE(ReserveLess)

BOOST_AUTO_TEST_CASE(Append)
{
DynamicSizeArray<TestStruct> test1;
DynamicSizeArray<TestStruct> test2;
DynamicSizeArray<DynamicSizeArrayTestStruct> test1;
DynamicSizeArray<DynamicSizeArrayTestStruct> test2;

test1.PushBack(TestStruct(3, 7));
test1.PushBack(TestStruct(5, 6));
test1.PushBack(DynamicSizeArrayTestStruct(3, 7));
test1.PushBack(DynamicSizeArrayTestStruct(5, 6));

test2.PushBack(TestStruct(42, 55));
test2.PushBack(TestStruct(47334, 3));
test2.PushBack(DynamicSizeArrayTestStruct(42, 55));
test2.PushBack(DynamicSizeArrayTestStruct(47334, 3));

BOOST_CHECK_EQUAL(test1.GetSize(), 2);
BOOST_CHECK_EQUAL(test2.GetSize(), 2);
Expand Down
Loading