Commit Graph

8 Commits

Author SHA1 Message Date
Thomas Roß
bdf992a8fd [CMake] Add cfile tests to 'tests' folder in IDEs. 2024-08-20 20:03:02 +02:00
Azamat H. Hackimov
7a1f08e811 Fix unittests on macOS
Surprisingly on macOS FS is case-insensitive.
2024-07-05 01:50:57 +03:00
Azamat H. Hackimov
b3affdb105 Use new cf_FindRealFileNameCaseInsensitive() function in code
A little speed-up for our slowpoke.
2024-07-05 01:50:57 +03:00
Azamat H. Hackimov
1a3c012228 Refactor cf_FindRealFileNameCaseInsensitive() function
Implementing cf_FindRealFileNameCaseInsensitive_new() based on std::fs::directory_iterator, which runs faster and more reliable.

cf_FindRealFileNameCaseInsensitive_new() works exactly as cf_FindRealFileNameCaseInsensitive().

Benchmark on Release build:

```
-------------------------------------------------------------------
Benchmark                         Time             CPU   Iterations
-------------------------------------------------------------------
cfile_no_exist_old            11607 ns        11399 ns        63035
cfile_no_exist_new             9302 ns         9196 ns        70041
cfile_exist_relative_old       2701 ns         2480 ns       282695
cfile_exist_relative_new        867 ns          866 ns       798478
cfile_exist_absolute_old       3415 ns         3167 ns       228323
cfile_exist_absolute_new       1182 ns         1181 ns       574782
```
2024-07-05 01:50:57 +03:00
Azamat H. Hackimov
f44f6a4bbd CFILE: change signature of cf_FindRealFileNameCaseInsenstive()
Moved directory parameter to 3rd position and make it optional.
2024-07-05 01:50:57 +03:00
Azamat H. Hackimov
c5712208f6 CFILE: Additional unit tests for cfile functions 2024-07-05 01:50:57 +03:00
Azamat H. Hackimov
15ec76dd64 CFILE: Change cf_FindRealFileNameCaseInsenstive() to use std::fs::path 2024-07-05 01:50:57 +03:00
Azamat H. Hackimov
dad20b0830 CFILE: Add unittest framework 2024-07-05 01:50:57 +03:00