Code Cleanup

- Cmake was not updating HAVE_ST_BIRTHTIME.
- NIBBLER_FEATURE_DATE was not properly applied everywhere.
- FEATURE_COLOR was not properly set.
- Some source files failed to include cmake.h, and therefore were not properly
- Removed inefficient use of std::string::substr for guaranteed single character
  strings.
- Integrated Directory::cd.
- Integrated File::ctime, ::btime.
- Integrated Path::operator+.
- Integrated Nibbler::getDigit{2,4,6}.
- Integrated HighResTimer.
  enabling/disabling code.
- All Path objects now expanded internally to absolute form.
- Modified unit tests to accomodate absolute paths.
- Merged new nibbler.t.cpp tests.
- Made various methods const.
- Includes removed from some files, added to others.
This commit is contained in:
Paul Beckingham
2013-05-05 08:33:52 -04:00
parent ebaf09cbe0
commit a1132f0028
24 changed files with 254 additions and 39 deletions

View File

@@ -27,6 +27,7 @@
#include <Context.h>
#include <Path.h>
#include <Directory.h>
#include <test.h>
Context context;
@@ -37,11 +38,11 @@ int main (int argc, char** argv)
// Path ();
Path p0;
t.ok (p0._data == "", "Path::Path");
t.is (p0._data, "", "Path::Path");
// Path (const Path&);
Path p1 = Path ("foo");
t.ok (p1._data == "foo", "Path::operator=");
t.is (p1._data, Directory::cwd () + "/foo", "Path::operator=");
// Path (const std::string&);
Path p2 ("~");
@@ -106,7 +107,7 @@ int main (int argc, char** argv)
// bool is_absolute () const;
t.notok (p0.is_absolute (), "'' !is_absolute");
t.notok (p1.is_absolute (), "foo !is_absolute");
t.ok (p1.is_absolute (), "foo is_absolute");
t.ok (p2.is_absolute (), "~ is_absolute (after expansion)");
t.ok (p3.is_absolute (), "/tmp is_absolute");
t.ok (p4.is_absolute (), "/a/b/c/file.ext is_absolute");