From 163d39cc4e81081d809b5c12c9cf60ee6db510f6 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 3 Sep 2013 23:00:37 +0200 Subject: use FileFd in HashSum test to unbreak non-linux ports The testcode happily mixes FILE* operations and direct access to fds which is even a bit suprising that it works on linux and worked so long for non-linux ports, so we switch to usage of FileFd instead which provides us with simple fd-only operations. Its overkill for this test as its a bare file and we ask for the descriptor all the time, but it shouldn't hurt to implicitly test it a bit this way. Closes: 721723 Thanks: Aaron M. Ucko --- test/libapt/hashsums_test.cc | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'test/libapt') diff --git a/test/libapt/hashsums_test.cc b/test/libapt/hashsums_test.cc index e2d0aec5b..3da89052b 100644 --- a/test/libapt/hashsums_test.cc +++ b/test/libapt/hashsums_test.cc @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -108,55 +109,54 @@ int main(int argc, char** argv) Test("The quick brown fox jumps over the lazy dog.", "91ea1245f20d46ae9a037a989f54f1f790f0a47607eeb8a14d12890cea77a1bb" "c6c7ed9cf205e67b7f2b8fd4c7dfd3a7a8617e45f3c463d481c7e586c39ac1ed"); - FILE* fd = fopen(argv[1], "r"); - if (fd == NULL) { + FileFd fd(argv[1], FileFd::ReadOnly); + if (fd.IsOpen() == false) { std::cerr << "Can't open file for 1. testing: " << argv[1] << std::endl; return 1; } { Hashes hashes; - hashes.AddFD(fileno(fd)); + hashes.AddFD(fd.Fd()); equals(argv[2], hashes.MD5.Result().Value()); equals(argv[3], hashes.SHA1.Result().Value()); equals(argv[4], hashes.SHA256.Result().Value()); equals(argv[5], hashes.SHA512.Result().Value()); } - fseek(fd, 0L, SEEK_END); - unsigned long sz = ftell(fd); - fseek(fd, 0L, SEEK_SET); + unsigned long sz = fd.FileSize(); + fd.Seek(0); { Hashes hashes; - hashes.AddFD(fileno(fd), sz); + hashes.AddFD(fd.Fd(), sz); equals(argv[2], hashes.MD5.Result().Value()); equals(argv[3], hashes.SHA1.Result().Value()); equals(argv[4], hashes.SHA256.Result().Value()); equals(argv[5], hashes.SHA512.Result().Value()); } - fseek(fd, 0L, SEEK_SET); + fd.Seek(0); { MD5Summation md5; - md5.AddFD(fileno(fd)); + md5.AddFD(fd.Fd()); equals(argv[2], md5.Result().Value()); } - fseek(fd, 0L, SEEK_SET); + fd.Seek(0); { SHA1Summation sha1; - sha1.AddFD(fileno(fd)); + sha1.AddFD(fd.Fd()); equals(argv[3], sha1.Result().Value()); } - fseek(fd, 0L, SEEK_SET); + fd.Seek(0); { SHA256Summation sha2; - sha2.AddFD(fileno(fd)); + sha2.AddFD(fd.Fd()); equals(argv[4], sha2.Result().Value()); } - fseek(fd, 0L, SEEK_SET); + fd.Seek(0); { SHA512Summation sha2; - sha2.AddFD(fileno(fd)); + sha2.AddFD(fd.Fd()); equals(argv[5], sha2.Result().Value()); } - fclose(fd); + fd.Close(); // test HashString code { -- cgit v1.2.3 From 00f4d9ffa3468e899abf8fbda8db71fc3143b8e5 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sat, 7 Sep 2013 12:19:51 +0200 Subject: implement StringSplit() as we need this to fix the dpkg status-fd output parsing --- test/libapt/strutil_test.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test/libapt') diff --git a/test/libapt/strutil_test.cc b/test/libapt/strutil_test.cc index bfe0d7222..bac9dd2f1 100644 --- a/test/libapt/strutil_test.cc +++ b/test/libapt/strutil_test.cc @@ -42,5 +42,22 @@ int main(int argc,char *argv[]) output = DeEscapeString(input); equals(output, expected); + // Split + input = "status: libnet1:amd64: unpacked"; + vector result = StringSplit(input, ": "); + equals(result[0], "status"); + equals(result[1], "libnet1:amd64"); + equals(result[2], "unpacked"); + equals(result.size(), 3); + + input = "status: libnet1:amd64: unpacked"; + result = StringSplit(input, "xxx"); + equals(result[0], input); + equals(result.size(), 1); + + input = "status: libnet1:amd64: unpacked"; + result = StringSplit(input, ""); + equals(result.size(), 0); + return 0; } -- cgit v1.2.3 From 85bf001994fa59ca979293af3abb89d3486e0afb Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sat, 7 Sep 2013 13:12:50 +0200 Subject: add maxsplit parameter to StringSplit --- test/libapt/strutil_test.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/libapt') diff --git a/test/libapt/strutil_test.cc b/test/libapt/strutil_test.cc index bac9dd2f1..b044b7f34 100644 --- a/test/libapt/strutil_test.cc +++ b/test/libapt/strutil_test.cc @@ -59,5 +59,11 @@ int main(int argc,char *argv[]) result = StringSplit(input, ""); equals(result.size(), 0); + input = "x:y:z"; + result = StringSplit(input, ":", 2); + equals(result.size(), 2); + equals(result[0], "x"); + equals(result[1], "y:z"); + return 0; } -- cgit v1.2.3 From 2ddab3fb958518acbd26685eeeb7755106b721a3 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 1 Oct 2013 12:38:03 +0200 Subject: change maxsplit default from "0" to maxint --- test/libapt/strutil_test.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/libapt') diff --git a/test/libapt/strutil_test.cc b/test/libapt/strutil_test.cc index b044b7f34..110a20d27 100644 --- a/test/libapt/strutil_test.cc +++ b/test/libapt/strutil_test.cc @@ -65,5 +65,9 @@ int main(int argc,char *argv[]) equals(result[0], "x"); equals(result[1], "y:z"); + input = "abc"; + result = StringSplit(input, ""); + equals(result.size(), 0); + return 0; } -- cgit v1.2.3 From cf993341c2067ee091cfd51e5da0e237babce171 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 29 Nov 2013 08:35:05 +0100 Subject: add "APT::String::Endswith" and automatic adding of ".list" in apt edit-source --- test/libapt/strutil_test.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/libapt') diff --git a/test/libapt/strutil_test.cc b/test/libapt/strutil_test.cc index 110a20d27..8215654d0 100644 --- a/test/libapt/strutil_test.cc +++ b/test/libapt/strutil_test.cc @@ -69,5 +69,23 @@ int main(int argc,char *argv[]) result = StringSplit(input, ""); equals(result.size(), 0); + // endswith + bool b; + input = "abcd"; + b = APT::String::Endswith(input, "d"); + equals(b, true); + + b = APT::String::Endswith(input, "cd"); + equals(b, true); + + b = APT::String::Endswith(input, "abcd"); + equals(b, true); + + b = APT::String::Endswith(input, "x"); + equals(b, false); + + b = APT::String::Endswith(input, "abcndefg"); + equals(b, false); + return 0; } -- cgit v1.2.3 From caeb19b796f7045f489dbce0bf681925d49136a9 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 2 Dec 2013 08:21:49 +0100 Subject: add unittest for new sourceslist parser as well --- test/libapt/makefile | 6 +++++ test/libapt/sourcelist_test.cc | 52 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 test/libapt/sourcelist_test.cc (limited to 'test/libapt') diff --git a/test/libapt/makefile b/test/libapt/makefile index 73403b24c..a8e053d6e 100644 --- a/test/libapt/makefile +++ b/test/libapt/makefile @@ -111,3 +111,9 @@ SLIBS = -lapt-pkg SOURCE = tagfile_test.cc include $(PROGRAM_H) +# test sourcelist +PROGRAM = SourceList${BASENAME} +SLIBS = -lapt-pkg +SOURCE = sourcelist_test.cc +include $(PROGRAM_H) + diff --git a/test/libapt/sourcelist_test.cc b/test/libapt/sourcelist_test.cc new file mode 100644 index 000000000..6e83d08e0 --- /dev/null +++ b/test/libapt/sourcelist_test.cc @@ -0,0 +1,52 @@ +#include +#include + +#include "assert.h" +#include +#include +#include + +char *tempfile = NULL; +int tempfile_fd = -1; + +void remove_tmpfile(void) +{ + if (tempfile_fd > 0) + close(tempfile_fd); + if (tempfile != NULL) { + unlink(tempfile); + free(tempfile); + } +} + +int main(int argc, char *argv[]) +{ + const char contents[] = "" + "Type: deb\n" + "URL: http://ftp.debian.org/debian\n" + "Dist: stable\n" + "Section: main\n" + "Comment: Some random string\n" + " that can be very long\n" + "\n" + "Type: deb\n" + "URL: http://ftp.debian.org/debian\n" + "Dist: unstable\n" + "Section: main non-free\n" + ; + + FileFd fd; + tempfile = strdup("apt-test.XXXXXXXX"); + tempfile_fd = mkstemp(tempfile); + + /* (Re-)Open (as FileFd), write and seek to start of the temp file */ + equals(fd.OpenDescriptor(tempfile_fd, FileFd::ReadWrite), true); + equals(fd.Write(contents, strlen(contents)), true); + equals(fd.Seek(0), true); + + pkgSourceList sources(tempfile); + equals(sources.size(), 2); + + /* clean up handled by atexit handler, so just return here */ + return 0; +} -- cgit v1.2.3 From a077861ad0f2e643307c2380a060a3b11914aa34 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 23 Dec 2013 13:35:08 +0100 Subject: add basic tests for GetTempDir() --- test/libapt/fileutl_test.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/libapt') diff --git a/test/libapt/fileutl_test.cc b/test/libapt/fileutl_test.cc index b6b8ac579..462bdefd9 100644 --- a/test/libapt/fileutl_test.cc +++ b/test/libapt/fileutl_test.cc @@ -38,5 +38,18 @@ int main(int argc,char *argv[]) return 1; } + // GetTempDir() + unsetenv("TMPDIR"); + equals(GetTempDir(), "/tmp"); + + setenv("TMPDIR", "", 1); + equals(GetTempDir(), "/tmp"); + + setenv("TMPDIR", "/not-there-no-really-not", 1); + equals(GetTempDir(), "/tmp"); + + setenv("TMPDIR", "/usr", 1); + equals(GetTempDir(), "/usr"); + return 0; } -- cgit v1.2.3 From 9aaa45283b14c3c81641f3f3e38157a267b1e8f7 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 15 Jan 2014 16:14:23 +0100 Subject: actually register the tempfile removal atexit Git-Dch: Ignore --- test/libapt/sourcelist_test.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'test/libapt') diff --git a/test/libapt/sourcelist_test.cc b/test/libapt/sourcelist_test.cc index 6e83d08e0..adadae6a7 100644 --- a/test/libapt/sourcelist_test.cc +++ b/test/libapt/sourcelist_test.cc @@ -36,6 +36,7 @@ int main(int argc, char *argv[]) ; FileFd fd; + atexit(remove_tmpfile); tempfile = strdup("apt-test.XXXXXXXX"); tempfile_fd = mkstemp(tempfile); -- cgit v1.2.3 From 78766f46d043c1c1eeb9869db7e1c5b4093d5274 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 16 Jan 2014 18:14:14 +0100 Subject: update libapt test --- test/libapt/sourcelist_test.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/libapt') diff --git a/test/libapt/sourcelist_test.cc b/test/libapt/sourcelist_test.cc index 6e83d08e0..1d30bd85b 100644 --- a/test/libapt/sourcelist_test.cc +++ b/test/libapt/sourcelist_test.cc @@ -23,15 +23,15 @@ int main(int argc, char *argv[]) { const char contents[] = "" "Type: deb\n" - "URL: http://ftp.debian.org/debian\n" - "Dist: stable\n" + "Uri: http://ftp.debian.org/debian\n" + "Suite: stable\n" "Section: main\n" "Comment: Some random string\n" " that can be very long\n" "\n" "Type: deb\n" - "URL: http://ftp.debian.org/debian\n" - "Dist: unstable\n" + "Uri: http://ftp.debian.org/debian\n" + "Suite: unstable\n" "Section: main non-free\n" ; -- cgit v1.2.3 From 62d8a765b9b37354efab6ca838cbdb7f347f7cac Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 16 Jan 2014 19:51:23 +0100 Subject: rework some code to fix some scan-build warnings No visible functional changes, just code moved around and additional checks to eliminate impossible branches Reported-By: scan-build Git-Dch: Ignore --- test/libapt/parsedepends_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/libapt') diff --git a/test/libapt/parsedepends_test.cc b/test/libapt/parsedepends_test.cc index 677b1c892..e95016240 100644 --- a/test/libapt/parsedepends_test.cc +++ b/test/libapt/parsedepends_test.cc @@ -176,7 +176,7 @@ test: equals("7.15.3~", Version); equals(Null | pkgCache::Dep::Equals | pkgCache::Dep::Or, Op); - Start = debListParser::ParseDepends(Start, End, Package, Version, Op, ParseArchFlags, StripMultiArch); + debListParser::ParseDepends(Start, End, Package, Version, Op, ParseArchFlags, StripMultiArch); if (StripMultiArch == true) equals("overlord-dev", Package); else -- cgit v1.2.3 From 866e9fadf892368fcb50e6a192bcdd350cfe8e5c Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 17 Jan 2014 20:41:55 +0100 Subject: implement suggestion by donkult (thanks!) --- test/libapt/sourcelist_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/libapt') diff --git a/test/libapt/sourcelist_test.cc b/test/libapt/sourcelist_test.cc index 1d30bd85b..6a625770f 100644 --- a/test/libapt/sourcelist_test.cc +++ b/test/libapt/sourcelist_test.cc @@ -23,14 +23,14 @@ int main(int argc, char *argv[]) { const char contents[] = "" "Type: deb\n" - "Uri: http://ftp.debian.org/debian\n" + "URI: http://ftp.debian.org/debian\n" "Suite: stable\n" "Section: main\n" "Comment: Some random string\n" " that can be very long\n" "\n" "Type: deb\n" - "Uri: http://ftp.debian.org/debian\n" + "URI: http://ftp.debian.org/debian\n" "Suite: unstable\n" "Section: main non-free\n" ; -- cgit v1.2.3 From 6c069a2247781754bcc8574687cb98b493c6ab8a Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sat, 18 Jan 2014 20:51:03 +0100 Subject: rename "Suite/Section" to plural --- test/libapt/sourcelist_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/libapt') diff --git a/test/libapt/sourcelist_test.cc b/test/libapt/sourcelist_test.cc index 6a625770f..ae5d11f66 100644 --- a/test/libapt/sourcelist_test.cc +++ b/test/libapt/sourcelist_test.cc @@ -24,8 +24,8 @@ int main(int argc, char *argv[]) const char contents[] = "" "Type: deb\n" "URI: http://ftp.debian.org/debian\n" - "Suite: stable\n" - "Section: main\n" + "Suites: stable\n" + "Sections: main\n" "Comment: Some random string\n" " that can be very long\n" "\n" -- cgit v1.2.3 From e67b9a23d7646d2f1e21bf4039fa71cc66b628c5 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 20 Jan 2014 07:43:17 +0100 Subject: add Description tag for deb822 sources --- test/libapt/sourcelist_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/libapt') diff --git a/test/libapt/sourcelist_test.cc b/test/libapt/sourcelist_test.cc index ae5d11f66..b9dd47207 100644 --- a/test/libapt/sourcelist_test.cc +++ b/test/libapt/sourcelist_test.cc @@ -26,8 +26,8 @@ int main(int argc, char *argv[]) "URI: http://ftp.debian.org/debian\n" "Suites: stable\n" "Sections: main\n" - "Comment: Some random string\n" - " that can be very long\n" + "Description: short\n" + " long description that can be very long\n" "\n" "Type: deb\n" "URI: http://ftp.debian.org/debian\n" -- cgit v1.2.3 From 75c10df1533ede97e05fef3d1e2fc6a22fc4db00 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 20 Jan 2014 08:10:50 +0100 Subject: add support for multiple URIs in deb822 style sources.list --- test/libapt/sourcelist_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/libapt') diff --git a/test/libapt/sourcelist_test.cc b/test/libapt/sourcelist_test.cc index b9dd47207..3597b3d58 100644 --- a/test/libapt/sourcelist_test.cc +++ b/test/libapt/sourcelist_test.cc @@ -23,14 +23,14 @@ int main(int argc, char *argv[]) { const char contents[] = "" "Type: deb\n" - "URI: http://ftp.debian.org/debian\n" + "URIs: http://ftp.debian.org/debian\n" "Suites: stable\n" "Sections: main\n" "Description: short\n" " long description that can be very long\n" "\n" "Type: deb\n" - "URI: http://ftp.debian.org/debian\n" + "URIs: http://ftp.debian.org/debian\n" "Suite: unstable\n" "Section: main non-free\n" ; -- cgit v1.2.3 From 7f316a3feab95370f1dd28c08c58bc3c140bf0a0 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 20 Jan 2014 08:17:43 +0100 Subject: add support for multipl types in one line --- test/libapt/sourcelist_test.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/libapt') diff --git a/test/libapt/sourcelist_test.cc b/test/libapt/sourcelist_test.cc index 3597b3d58..6ab30ba67 100644 --- a/test/libapt/sourcelist_test.cc +++ b/test/libapt/sourcelist_test.cc @@ -22,17 +22,17 @@ void remove_tmpfile(void) int main(int argc, char *argv[]) { const char contents[] = "" - "Type: deb\n" + "Types: deb\n" "URIs: http://ftp.debian.org/debian\n" "Suites: stable\n" "Sections: main\n" "Description: short\n" " long description that can be very long\n" "\n" - "Type: deb\n" + "Types: deb\n" "URIs: http://ftp.debian.org/debian\n" - "Suite: unstable\n" - "Section: main non-free\n" + "Suites: unstable\n" + "Sections: main non-free\n" ; FileFd fd; -- cgit v1.2.3 From 5d9667d92a9d6973fc001c27d618bc878a4df2ba Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 24 Jan 2014 23:29:10 +0100 Subject: fix test --- test/libapt/sourcelist_test.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test/libapt') diff --git a/test/libapt/sourcelist_test.cc b/test/libapt/sourcelist_test.cc index 6fc84fd93..0300ce929 100644 --- a/test/libapt/sourcelist_test.cc +++ b/test/libapt/sourcelist_test.cc @@ -21,6 +21,8 @@ void remove_tmpfile(void) int main(int argc, char *argv[]) { + _config->Set("APT::Sources::Use-Deb822", true); + const char contents[] = "" "Types: deb\n" "URIs: http://ftp.debian.org/debian\n" -- cgit v1.2.3 From 1e3f4083db29bba600b9725e9456b0e140975c99 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sat, 22 Feb 2014 18:34:33 +0100 Subject: Fix typos in documentation (codespell) --- test/libapt/globalerror_test.cc | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'test/libapt') diff --git a/test/libapt/globalerror_test.cc b/test/libapt/globalerror_test.cc index 72044d493..b6939231d 100644 --- a/test/libapt/globalerror_test.cc +++ b/test/libapt/globalerror_test.cc @@ -15,17 +15,17 @@ int main(int argc,char *argv[]) equals(_error->empty(), true); equals(_error->empty(GlobalError::DEBUG), false); equals(_error->PendingError(), false); - equals(_error->Error("%s horrible %s %d times", "Something", "happend", 2), false); + equals(_error->Error("%s horrible %s %d times", "Something", "happened", 2), false); equals(_error->PendingError(), true); std::string text; equals(_error->PopMessage(text), false); equals(_error->PendingError(), true); equals(text, "A Notice"); equals(_error->PopMessage(text), true); - equals(text, "Something horrible happend 2 times"); + equals(text, "Something horrible happened 2 times"); equals(_error->empty(GlobalError::DEBUG), true); equals(_error->PendingError(), false); - equals(_error->Error("%s horrible %s %d times", "Something", "happend", 2), false); + equals(_error->Error("%s horrible %s %d times", "Something", "happened", 2), false); equals(_error->PendingError(), true); equals(_error->empty(GlobalError::FATAL), false); _error->Discard(); @@ -33,7 +33,7 @@ int main(int argc,char *argv[]) equals(_error->empty(), true); equals(_error->PendingError(), false); equals(_error->Notice("%s Notice", "A"), false); - equals(_error->Error("%s horrible %s %d times", "Something", "happend", 2), false); + equals(_error->Error("%s horrible %s %d times", "Something", "happened", 2), false); equals(_error->PendingError(), true); equals(_error->empty(GlobalError::NOTICE), false); _error->PushToStack(); @@ -49,12 +49,12 @@ int main(int argc,char *argv[]) equals(_error->PendingError(), true); equals(text, "A Notice"); equals(_error->PopMessage(text), true); - equals(text, "Something horrible happend 2 times"); + equals(text, "Something horrible happened 2 times"); equals(_error->PendingError(), false); equals(_error->empty(), true); equals(_error->Notice("%s Notice", "A"), false); - equals(_error->Error("%s horrible %s %d times", "Something", "happend", 2), false); + equals(_error->Error("%s horrible %s %d times", "Something", "happened", 2), false); equals(_error->PendingError(), true); equals(_error->empty(GlobalError::NOTICE), false); _error->PushToStack(); @@ -70,7 +70,7 @@ int main(int argc,char *argv[]) equals(_error->PendingError(), true); equals(text, "A Notice"); equals(_error->PopMessage(text), true); - equals(text, "Something horrible happend 2 times"); + equals(text, "Something horrible happened 2 times"); equals(_error->PendingError(), false); equals(_error->empty(), false); equals(_error->PopMessage(text), false); @@ -78,24 +78,24 @@ int main(int argc,char *argv[]) equals(_error->empty(), true); errno = 0; - equals(_error->Errno("errno", "%s horrible %s %d times", "Something", "happend", 2), false); + equals(_error->Errno("errno", "%s horrible %s %d times", "Something", "happened", 2), false); equals(_error->empty(), false); equals(_error->PendingError(), true); equals(_error->PopMessage(text), true); equals(_error->PendingError(), false); - equals(text, std::string("Something horrible happend 2 times - errno (0: ").append(textOfErrnoZero).append(")")); + equals(text, std::string("Something horrible happened 2 times - errno (0: ").append(textOfErrnoZero).append(")")); equals(_error->empty(), true); std::string longText; for (size_t i = 0; i < 500; ++i) longText.append("a"); - equals(_error->Error("%s horrible %s %d times", longText.c_str(), "happend", 2), false); + equals(_error->Error("%s horrible %s %d times", longText.c_str(), "happened", 2), false); equals(_error->PopMessage(text), true); - equals(text, std::string(longText).append(" horrible happend 2 times")); + equals(text, std::string(longText).append(" horrible happened 2 times")); - equals(_error->Errno("errno", "%s horrible %s %d times", longText.c_str(), "happend", 2), false); + equals(_error->Errno("errno", "%s horrible %s %d times", longText.c_str(), "happened", 2), false); equals(_error->PopMessage(text), true); - equals(text, std::string(longText).append(" horrible happend 2 times - errno (0: ").append(textOfErrnoZero).append(")")); + equals(text, std::string(longText).append(" horrible happened 2 times - errno (0: ").append(textOfErrnoZero).append(")")); equals(_error->Warning("Репозиторий не обновлён и будут %d %s", 4, "test"), false); equals(_error->PopMessage(text), false); -- cgit v1.2.3