View Issue Details

IDProjectCategoryView StatusLast Update
0024456Open CASCADEOCCT:Visualizationpublic2014-05-05 13:37
Reporterkgv Assigned Tobugmaster  
PrioritylowSeverityintegration request 
Status closedResolutionfixed 
PlatformAOSL 
Target Version6.7.1Fixed in Version6.7.1 
Summary0024456: Graphic3d_MaterialAspect - use static assert instead of runtime exception
DescriptionIt is suggested to replace runtime check with compile-time check within the following piece of code:
Standard_Integer Graphic3d_MaterialAspect::NumberOfMaterials() {
Standard_Integer n =sizeof(theMaterials)/sizeof(Material);
  if( n > Graphic3d_NOM_DEFAULT ) {
    cout << " *** Graphic3d_MaterialAspect::NumberOfMaterials() may return a badvalue due to incoherente size between material name array and enum" << endl;
  }
  return Graphic3d_NOM_DEFAULT;
}
TagsNo tags attached.
Test case numberNot needed

Activities

omy

2013-12-11 18:39

developer   ~0027173

Dear kgv,
The fix has been made in branch CR24456.
Please, review.

kgv

2013-12-12 11:30

developer   ~0027182

Patch is ready for testing.

abv

2013-12-12 12:20

manager   ~0027183

The assert used in CR24456 is not a static one

omy

2013-12-12 13:13

developer   ~0027186

Dear abv,
The fix has been made within branch CR24456_1.
Please, review.

apn

2013-12-16 18:14

administrator   ~0027225

Dear BugMaster,

Branch CR24456_1 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
SHA-1: 0282572efc2bf9ab2430339e64446709e7f0d8d3

Number of compiler warnings:

occt component :
Linux: 103 (103 on master)
Windows: 0 (0 on master)

products component :
Linux: 21 (21 on master)
Windows: 8 (8 on master)

Regressions/Differences:
No regressions/differences

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 359088036 / 359777368
Total CPU difference: 43823.73000000012 / 56948.770000000084

Testing on Windows:
Total MEMORY difference: 413526316 / 412942520
Total CPU difference: 33900.53125 / 29160.5

There are not differences in images found by testdiff.

Related Changesets

occt: master b5eb7166

2013-12-19 10:17:33

omy


Committer: bugmaster Details Diff
0024456: Graphic3d_MaterialAspect - use static assert instead of runtime exception

Graphic3d_MaterialAspect::NumberOfMaterials() : Standard_ASSERT_RAISE instead of run-time check is now used.
Replaced with Standard_STATIC_ASSERT
Affected Issues
0024456
mod - src/Graphic3d/Graphic3d_MaterialAspect.cxx Diff File

Issue History

Date Modified Username Field Change
2013-12-11 17:15 kgv New Issue
2013-12-11 17:15 kgv Assigned To => omy
2013-12-11 17:15 kgv Status new => assigned
2013-12-11 17:16 kgv Summary Graphic3d_MaterialAspect - use static assert instead of runtime exeption => Graphic3d_MaterialAspect - use static assert instead of runtime exception
2013-12-11 18:39 omy Note Added: 0027173
2013-12-11 18:39 omy Assigned To omy => kgv
2013-12-11 18:39 omy Status assigned => resolved
2013-12-12 11:30 kgv Note Added: 0027182
2013-12-12 11:30 kgv Assigned To kgv => bugmaster
2013-12-12 11:30 kgv Status resolved => reviewed
2013-12-12 12:20 abv Note Added: 0027183
2013-12-12 12:27 kgv Assigned To bugmaster => omy
2013-12-12 12:27 kgv Status reviewed => assigned
2013-12-12 13:13 omy Note Added: 0027186
2013-12-12 13:13 omy Assigned To omy => abv
2013-12-12 13:13 omy Status assigned => resolved
2013-12-13 08:50 kgv Assigned To abv => bugmaster
2013-12-13 08:50 kgv Status resolved => reviewed
2013-12-13 16:09 apn Assigned To bugmaster => apn
2013-12-16 18:14 apn Note Added: 0027225
2013-12-16 18:15 apn Test case number => Not needed
2013-12-16 18:15 apn Assigned To apn => bugmaster
2013-12-16 18:15 apn Status reviewed => tested
2013-12-23 13:05 bugmaster Changeset attached => occt master b5eb7166
2013-12-23 13:05 bugmaster Status tested => verified
2013-12-23 13:05 bugmaster Resolution open => fixed
2014-05-05 13:36 aiv Status verified => closed
2014-05-05 13:37 aiv Fixed in Version => 6.7.1