MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / exists

Method exists

test/testpath.cpp:585–609  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

583 }
584
585 void exists() const {
586 ScopedFile file("testpath.txt", "", "testpath");
587 ScopedFile file2("testpath2.txt", "");
588
589 ASSERT_EQUALS(true, Path::exists("testpath"));
590 ASSERT_EQUALS(true, Path::exists("testpath2.txt"));
591
592 ASSERT_EQUALS(false, Path::exists("testpath2"));
593
594 bool b = false;
595
596 ASSERT_EQUALS(true, Path::exists("testpath", &b));
597 ASSERT_EQUALS(true, b);
598 ASSERT_EQUALS(true, Path::exists("testpath/testpath.txt", &b));
599 ASSERT_EQUALS(false, b);
600 ASSERT_EQUALS(true, Path::exists("testpath2.txt", &b));
601 ASSERT_EQUALS(false, b);
602
603 ASSERT_EQUALS(false, Path::exists("testpath2", &b));
604 ASSERT_EQUALS(false, b);
605 ASSERT_EQUALS(false, Path::exists("testpath/testpath2.txt", &b));
606 ASSERT_EQUALS(false, b);
607 ASSERT_EQUALS(false, Path::exists("testpath.txt", &b));
608 ASSERT_EQUALS(false, b);
609 }
610
611 void fromNativeSeparators() const {
612 ASSERT_EQUALS("lib/file.c", Path::fromNativeSeparators("lib/file.c"));

Callers 15

clone_cppcheckFunction · 0.45
__remove_treeFunction · 0.45
__wgetFunction · 0.45
scan_packageFunction · 0.45
test-my-pr.pyFile · 0.45
serverFunction · 0.45
mainFunction · 0.45
donate-cpu.pyFile · 0.45
MainWindowMethod · 0.45
build_cppcheckFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected