Skip to content

Commit decef8e

Browse files
committed
fix a unittest reported error on nvidia
1 parent 81bfa24 commit decef8e

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

EasyCL

test/gtest_supp.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ inline ::testing::AssertionResult AssertFloatsNear( const char *expr_one, const
99
if( absdiff <= absone * 0.0001f ) {
1010
return ::testing::AssertionSuccess();
1111
}
12+
if( absdiff < 0.000000000000001f ) {
13+
return ::testing::AssertionSuccess();
14+
}
1215
std::string onestr = toString(one);
1316
std::string twostr = toString(two);
1417
return ::testing::AssertionFailure()

test/testCopyLocal.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ TEST( testCopyLocal, basic ) {
4343
cout << endl;
4444
for( int i = 12; i < 16; i++ ) {
4545
cout << b[i] << " ";
46-
EXPECT_EQ( 0, b[i] );
46+
EXPECT_FLOAT_NEAR( 0, b[i] );
4747
}
4848
cout << endl;
4949

0 commit comments

Comments
 (0)