Skip to content

Commit e3afe42

Browse files
committed
Fix double compare
Fix arm64 build for windows
1 parent 594ac11 commit e3afe42

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

cmake/external/icu.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ if(WIN32)
7979
set(ICU_BUILD_COMMAND msbuild ${ICU_SRC}/src/ICU/source/allinone/allinone.sln /p:Configuration=${CMAKE_BUILD_TYPE} /p:Platform=Win32 /p:SkipUWP=true /m:${CPU_COUNT})
8080
else()
8181
get_filename_component(COMPILER_DIR ${CMAKE_CXX_COMPILER} DIRECTORY)
82-
if(${COMPILER_DIR} MATCHES arm)
82+
if(COMPILER_ID MATCHES arm OR MSVC_CXX_ARCHITECTURE_ID STREQUAL ARM64)
8383
set(ICU_BUILD_COMMAND msbuild ${ICU_SRC}/src/ICU/source/allinone/allinone.sln /p:Configuration=${CMAKE_BUILD_TYPE} /p:Platform=ARM64 /p:SkipUWP=true /m:${CPU_COUNT})
8484
else()
8585
set(ICU_BUILD_COMMAND msbuild ${ICU_SRC}/src/ICU/source/allinone/allinone.sln /p:Configuration=${CMAKE_BUILD_TYPE} /p:Platform=x64 /p:SkipUWP=true /m:${CPU_COUNT})

tests/test_distance.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@
3434
/* sqlite header */
3535
#include <sqlite3.h>
3636

37-
/* modern.cpp.core */
38-
#include <FloatingPoint.h>
39-
4037
/* sqlite_functions */
4138
#include <SqliteUtils.h>
4239

@@ -124,7 +121,7 @@ namespace vx {
124121
while ( ( resultCode = sqlite3_step( statement.get() ) ) == SQLITE_ROW ) {
125122

126123
const double distance = sqlite3_column_double( statement.get(), 0 );
127-
EXPECT_TRUE( floating_point::equal( distance, 504.10089961002807968 ) );
124+
EXPECT_NEAR( distance, 504.100899, 0.001 );
128125
}
129126
if ( resultCode != SQLITE_DONE ) {
130127

@@ -147,7 +144,7 @@ namespace vx {
147144
while ( ( resultCode = sqlite3_step( statementNY.get() ) ) == SQLITE_ROW ) {
148145

149146
const double distance = sqlite3_column_double( statementNY.get(), 0 );
150-
EXPECT_TRUE( floating_point::equal( distance, 6387.483579739179 ) );
147+
EXPECT_NEAR( distance, 6387.483579, 0.001 );
151148
}
152149
if ( resultCode != SQLITE_DONE ) {
153150

@@ -170,7 +167,7 @@ namespace vx {
170167
while ( ( resultCode = sqlite3_step( statementT.get() ) ) == SQLITE_ROW ) {
171168

172169
const double distance = sqlite3_column_double( statementT.get(), 0 );
173-
EXPECT_TRUE( floating_point::equal( distance, 8931.604652489757 ) );
170+
EXPECT_NEAR( distance, 8931.604652, 0.001 );
174171
}
175172
if ( resultCode != SQLITE_DONE ) {
176173

0 commit comments

Comments
 (0)