Skip to content

Commit 1b8d8e4

Browse files
committed
LLVMCodeBuilder: Use string comparison functions in tests
1 parent bbd0a4a commit 1b8d8e4

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

test/llvm/llvmcodebuilder_test.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,8 @@ class LLVMCodeBuilderTest : public testing::Test
246246
case OpType::StrCmpEQCS:
247247
return v1.toString() == v2.toString();
248248

249-
case OpType::StrCmpEQCI: {
250-
// TODO: Use a custom function for string comparison
251-
std::string str1 = v1.toString();
252-
std::string str2 = v2.toString();
253-
return strcasecmp(str1.c_str(), str2.c_str()) == 0;
254-
}
249+
case OpType::StrCmpEQCI:
250+
return string_compare_case_insensitive(value_toStringPtr(&v1.data()), value_toStringPtr(&v2.data())) == 0;
255251

256252
case OpType::And:
257253
return v1.toBool() && v2.toBool();

0 commit comments

Comments
 (0)