MCPcopy Create free account
hub / github.com/NVIDIA-RTX/Donut / test_strcasecmp

Function test_strcasecmp

tests/src/core/test_string_utils.cpp:32–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30using namespace donut::math;
31
32void test_strcasecmp()
33{
34 typedef std::string S;
35 typedef std::string_view SV;
36
37 CHECK(ds::strcasecmp(S("hello world"), S("hello world")) == true);
38 CHECK(ds::strcasecmp(SV("hello world"), SV("hello world")) == true);
39
40 CHECK(ds::strcasecmp(S("hello world "), S("hello world")) == false);
41 CHECK(ds::strcasecmp(SV("hello world "), SV("hello world")) == false);
42
43 CHECK(ds::strcasecmp(S("HeLlo World"), S("hello world")) == true);
44 CHECK(ds::strcasecmp(SV("HeLlo World"), SV("hello world")) == true);
45
46 CHECK(ds::strcasecmp(S("HeLl0 World"), S("hell0 world")) == true);
47 CHECK(ds::strcasecmp(SV("HeLl0 World"), SV("hell0 world")) == true);
48
49 CHECK(ds::strcasecmp(S("YES"), S("NO")) == false);
50 CHECK(ds::strcasecmp(SV("YES"), SV("NO")) == false);
51
52 CHECK(ds::strcasecmp(S("0"), S("1")) == false);
53 CHECK(ds::strcasecmp(SV("0"), SV("1")) == false);
54
55 CHECK(ds::strcasecmp(S("10"), S("1")) == false);
56 CHECK(ds::strcasecmp(SV("10"), SV("1")) == false);
57
58 CHECK(ds::strcasencmp(S("hello"), S("hello world"), 5) == true);
59 CHECK(ds::strcasencmp(SV("hello"), SV("hello world"), 5) == true);
60
61 CHECK(ds::strcasencmp(S("foo"), S("foobar"), 3) == true);
62 CHECK(ds::strcasencmp(SV("foo"), SV("foobar"), 3) == true);
63
64 CHECK(ds::strcasencmp(S("foo"), S("foobar"), 4) == false);
65 CHECK(ds::strcasencmp(SV("foo"), SV("foobar"), 4) == false);
66
67
68}
69
70void test_trim()
71{

Callers 1

mainFunction · 0.85

Calls 2

strcasecmpFunction · 0.85
strcasencmpFunction · 0.85

Tested by

no test coverage detected