chameerawijebandara / googletest

Automatically exported from code.google.com/p/googletest
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Errors in library cause SEH exceptions #392

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
While i am using fixtures,

"""
for(UINT i=0;i<count;i++)ASSERT_TRUE(this->signal==this->matr.ave[i]);

"""
and
"""
for(UINT i=0;i<count;i++)ASSERT_EQ(this->signal,this->matr.ave[i]);
"""
cause

"""

unknown file: error: SEH exception with code 0xc0000005 thrown in the test body.
"""

on debug.

But...
"""
BYTE averageArrayHasWrongValues=0;
    for(UINT i=0;i<count;i++)if(this->signal==this->matr.ave[i])averageArrayHasWrongValues=1;
    ASSERT_FALSE(averageArrayHasWrongValues);
"""

is passed!!!
You have some errors in your library.

Environment:
Visual C++ 2011
Windows 7
gtest is compilead as ashared library.

Original issue reported on code.google.com by kolan...@gmail.com on 23 Nov 2011 at 6:29

GoogleCodeExporter commented 9 years ago
little mistaken
if we try
for(UINT i=0;i<count;i++)ASSERT_EQ(this->signal,this->matr.ave[i]);
it writes

t_test.cpp(69): error: Value of: this->signal==this->matr.ave[i]
  Actual: false
Expected: true

and in output panel of VS:
HEAP[ccdTest_Test.exe]: Invalid address specified to RtlValidateHeap( 006A0000, 
008C5AE8 )

if we write
BYTE averageArrayHasWrongValues=0;
    for(UINT i=0;i<count;i++)if(this->signal==this->matr.ave[i])averageArrayHasWrongValues=1;
averageArrayHasWrongValues=1;
    ASSERT_FALSE(averageArrayHasWrongValues);

it also throws exception

FIX IT

Original comment by kolan...@gmail.com on 23 Nov 2011 at 6:57

GoogleCodeExporter commented 9 years ago
Please provide a short but complete program + compiler settings + command line 
flags that will allow us to reproduce the issue.

Original comment by vladlosev on 9 Dec 2011 at 7:48

GoogleCodeExporter commented 9 years ago

Original comment by vladlosev on 9 Dec 2011 at 7:48

GoogleCodeExporter commented 9 years ago
Here is an archive containing VS solution, project and source files.

Original comment by kolan...@gmail.com on 23 Apr 2012 at 4:44

Attachments:

GoogleCodeExporter commented 9 years ago
Just build it and run using VS.
Flags are the default ones.

Original comment by kolan...@gmail.com on 23 Apr 2012 at 4:46