aboutsummaryrefslogtreecommitdiffstats
path: root/libtests/buffer.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-02-08 15:18:08 +0100
committerJay Berkenbilt <ejb@ql.org>2022-02-08 17:51:15 +0100
commitcb769c62e55599e9f980001830bc61d9fcaa64a9 (patch)
tree0bf980c385a61cbc8720cf990762ffc1200f9d6a /libtests/buffer.cc
parent716381f65a2b2dc72f8da2426ba71aeab02c507f (diff)
downloadqpdf-cb769c62e55599e9f980001830bc61d9fcaa64a9.tar.zst
WHITESPACE ONLY -- expand tabs in source code
This comment expands all tabs using an 8-character tab-width. You should ignore this commit when using git blame or use git blame -w. In the early days, I used to use tabs where possible for indentation, since emacs did this automatically. In recent years, I have switched to only using spaces, which means qpdf source code has been a mixture of spaces and tabs. I have avoided cleaning this up because of not wanting gratuitous whitespaces change to cloud the output of git blame, but I changed my mind after discussing with users who view qpdf source code in editors/IDEs that have other tab widths by default and in light of the fact that I am planning to start applying automatic code formatting soon.
Diffstat (limited to 'libtests/buffer.cc')
-rw-r--r--libtests/buffer.cc96
1 files changed, 48 insertions, 48 deletions
diff --git a/libtests/buffer.cc b/libtests/buffer.cc
index 23d82e7b..ea36a807 100644
--- a/libtests/buffer.cc
+++ b/libtests/buffer.cc
@@ -36,54 +36,54 @@ int main()
try
{
- Pl_Discard discard;
- Pl_Count count("count", &discard);
- Pl_Buffer bp1("bp1", &count);
- bp1.write(uc("12345"), 5);
- bp1.write(uc("67890"), 5);
- bp1.finish();
- std::cout << "count: " << count.getCount() << std::endl;
- bp1.write(uc("abcde"), 5);
- bp1.write(uc("fghij"), 6);
- bp1.finish();
- std::cout << "count: " << count.getCount() << std::endl;
- Buffer* b = bp1.getBuffer();
- std::cout << "size: " << b->getSize() << std::endl;
- std::cout << "data: " << b->getBuffer() << std::endl;
- delete b;
- bp1.write(uc("qwert"), 5);
- bp1.write(uc("yuiop"), 6);
- bp1.finish();
- std::cout << "count: " << count.getCount() << std::endl;
- b = bp1.getBuffer();
- std::cout << "size: " << b->getSize() << std::endl;
- std::cout << "data: " << b->getBuffer() << std::endl;
- delete b;
+ Pl_Discard discard;
+ Pl_Count count("count", &discard);
+ Pl_Buffer bp1("bp1", &count);
+ bp1.write(uc("12345"), 5);
+ bp1.write(uc("67890"), 5);
+ bp1.finish();
+ std::cout << "count: " << count.getCount() << std::endl;
+ bp1.write(uc("abcde"), 5);
+ bp1.write(uc("fghij"), 6);
+ bp1.finish();
+ std::cout << "count: " << count.getCount() << std::endl;
+ Buffer* b = bp1.getBuffer();
+ std::cout << "size: " << b->getSize() << std::endl;
+ std::cout << "data: " << b->getBuffer() << std::endl;
+ delete b;
+ bp1.write(uc("qwert"), 5);
+ bp1.write(uc("yuiop"), 6);
+ bp1.finish();
+ std::cout << "count: " << count.getCount() << std::endl;
+ b = bp1.getBuffer();
+ std::cout << "size: " << b->getSize() << std::endl;
+ std::cout << "data: " << b->getBuffer() << std::endl;
+ delete b;
- Pl_Buffer bp2("bp2");
- bp2.write(uc("moo"), 3);
- bp2.write(uc("quack"), 6);
- try
- {
- delete bp2.getBuffer();
- }
- catch (std::exception& e)
- {
- std::cout << e.what() << std::endl;
- }
- bp2.finish();
- b = bp2.getBuffer();
- std::cout << "size: " << b->getSize() << std::endl;
- std::cout << "data: " << b->getBuffer() << std::endl;
- delete b;
+ Pl_Buffer bp2("bp2");
+ bp2.write(uc("moo"), 3);
+ bp2.write(uc("quack"), 6);
+ try
+ {
+ delete bp2.getBuffer();
+ }
+ catch (std::exception& e)
+ {
+ std::cout << e.what() << std::endl;
+ }
+ bp2.finish();
+ b = bp2.getBuffer();
+ std::cout << "size: " << b->getSize() << std::endl;
+ std::cout << "data: " << b->getBuffer() << std::endl;
+ delete b;
- unsigned char lbuf[10];
- Buffer b1(lbuf, 10);
- if (! ((b1.getBuffer() == lbuf) &&
- (b1.getSize() == 10)))
- {
- throw std::logic_error("hand-created buffer is not as expected");
- }
+ unsigned char lbuf[10];
+ Buffer b1(lbuf, 10);
+ if (! ((b1.getBuffer() == lbuf) &&
+ (b1.getSize() == 10)))
+ {
+ throw std::logic_error("hand-created buffer is not as expected");
+ }
Pl_Buffer bp3("bp3");
b = bp3.getBuffer();
@@ -127,8 +127,8 @@ int main()
}
catch (std::exception& e)
{
- std::cout << "unexpected exception: " << e.what() << std::endl;
- exit(2);
+ std::cout << "unexpected exception: " << e.what() << std::endl;
+ exit(2);
}
std::cout << "done" << std::endl;