Merge pull request #3171 from assimp/kimkulling-patch-github-actions
Add sanitizer supportpull/3170/head^2
commit
b495c42a33
|
@ -0,0 +1,56 @@
|
|||
name: C/C++ Sanitizer
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
job1:
|
||||
name: adress-sanitizer
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: lukka/get-cmake@latest
|
||||
- uses: lukka/set-shell-env@v1
|
||||
with:
|
||||
CXX: clang++
|
||||
CC: clang
|
||||
|
||||
- name: configure and build
|
||||
uses: lukka/run-cmake@v2
|
||||
with:
|
||||
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
||||
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
|
||||
cmakeAppendedArgs: '-GNinja -DCMAKE_BUILD_TYPE=Debug -DASSIMP_ASAN=ON'
|
||||
buildWithCMakeArgs: '-- -v'
|
||||
buildDirectory: '${{ github.workspace }}/build/'
|
||||
|
||||
- name: test
|
||||
run: cd build/bin && ./unit
|
||||
shell: bash
|
||||
|
||||
job2:
|
||||
name: undefined-behavior-sanitizer
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: lukka/get-cmake@latest
|
||||
- uses: lukka/set-shell-env@v1
|
||||
with:
|
||||
CXX: clang++
|
||||
CC: clang
|
||||
|
||||
- name: configure and build
|
||||
uses: lukka/run-cmake@v2
|
||||
with:
|
||||
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
||||
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
|
||||
cmakeAppendedArgs: '-GNinja -DCMAKE_BUILD_TYPE=Debug -DASSIMP_UBSAN=ON'
|
||||
buildWithCMakeArgs: '-- -v'
|
||||
buildDirectory: '${{ github.workspace }}/build/'
|
||||
|
||||
- name: test
|
||||
run: cd build/bin && ./unit
|
||||
shell: bash
|
|
@ -979,7 +979,7 @@ void GetArrayCopy(Type*& dest, ai_uint num ) {
|
|||
|
||||
dest = new Type[num];
|
||||
::memcpy(dest, old, sizeof(Type) * num);
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void SceneCombiner::CopySceneFlat(aiScene** _dest,const aiScene* src) {
|
||||
|
@ -1269,9 +1269,6 @@ void SceneCombiner::Copy(aiBone** _dest, const aiBone* src) {
|
|||
|
||||
// get a flat copy
|
||||
*dest = *src;
|
||||
|
||||
// and reallocate all arrays
|
||||
GetArrayCopy( dest->mWeights, dest->mNumWeights );
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -3401,7 +3401,8 @@ void FBXConverter::ConvertGlobalSettings() {
|
|||
mSceneOut->mMetaData->Set(5, "CoordAxisSign", doc.GlobalSettings().CoordAxisSign());
|
||||
mSceneOut->mMetaData->Set(6, "OriginalUpAxis", doc.GlobalSettings().OriginalUpAxis());
|
||||
mSceneOut->mMetaData->Set(7, "OriginalUpAxisSign", doc.GlobalSettings().OriginalUpAxisSign());
|
||||
mSceneOut->mMetaData->Set(8, "UnitScaleFactor", (double)doc.GlobalSettings().UnitScaleFactor());
|
||||
//const double unitScaleFactor = (double)doc.GlobalSettings().UnitScaleFactor();
|
||||
mSceneOut->mMetaData->Set(8, "UnitScaleFactor", doc.GlobalSettings().UnitScaleFactor());
|
||||
mSceneOut->mMetaData->Set(9, "OriginalUnitScaleFactor", doc.GlobalSettings().OriginalUnitScaleFactor());
|
||||
mSceneOut->mMetaData->Set(10, "AmbientColor", doc.GlobalSettings().AmbientColor());
|
||||
mSceneOut->mMetaData->Set(11, "FrameRate", (int)doc.GlobalSettings().TimeMode());
|
||||
|
|
|
@ -308,7 +308,10 @@ struct aiBone {
|
|||
|
||||
//! Copy constructor
|
||||
aiBone(const aiBone &other) :
|
||||
mName(other.mName), mNumWeights(other.mNumWeights), mWeights(nullptr), mOffsetMatrix(other.mOffsetMatrix) {
|
||||
mName(other.mName),
|
||||
mNumWeights(other.mNumWeights),
|
||||
mWeights(nullptr),
|
||||
mOffsetMatrix(other.mOffsetMatrix) {
|
||||
if (other.mWeights && other.mNumWeights) {
|
||||
mWeights = new aiVertexWeight[mNumWeights];
|
||||
::memcpy(mWeights, other.mWeights, mNumWeights * sizeof(aiVertexWeight));
|
||||
|
|
|
@ -320,7 +320,7 @@ struct aiMetadata {
|
|||
}
|
||||
|
||||
template <typename T>
|
||||
inline bool Set( const std::string &key, const T &value ) {
|
||||
inline bool Set(const std::string &key, const T &value) {
|
||||
if (key.empty()) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -210,13 +210,13 @@ TEST_F(utFBXImporterExporter, importUnitScaleFactor) {
|
|||
EXPECT_NE(nullptr, scene);
|
||||
EXPECT_NE(nullptr, scene->mMetaData);
|
||||
|
||||
double factor(0.0);
|
||||
float factor(0.0f);
|
||||
scene->mMetaData->Get("UnitScaleFactor", factor);
|
||||
EXPECT_DOUBLE_EQ(500.0, factor);
|
||||
EXPECT_EQ(500.0f, factor);
|
||||
|
||||
scene->mMetaData->Set("UnitScaleFactor", factor * 2);
|
||||
scene->mMetaData->Set("UnitScaleFactor", factor * 2.0f);
|
||||
scene->mMetaData->Get("UnitScaleFactor", factor);
|
||||
EXPECT_DOUBLE_EQ(1000.0, factor);
|
||||
EXPECT_EQ(1000.0f, factor);
|
||||
}
|
||||
|
||||
TEST_F(utFBXImporterExporter, importEmbeddedAsciiTest) {
|
||||
|
|
Loading…
Reference in New Issue