diff options
author | Nathan Binkert <nate@binkert.org> | 2008-10-02 11:26:59 -0700 |
---|---|---|
committer | Nathan Binkert <nate@binkert.org> | 2008-10-02 11:26:59 -0700 |
commit | 52493b27202fb61aaae74779ebcd91ca8f2bbc2c (patch) | |
tree | eafc46fbeb182b85c766910dfcef544df2e1723a /src/unittest/circletest.cc | |
parent | 67a2918abc057f8f6d693d8acadd70bf9337cf44 (diff) | |
download | gem5-52493b27202fb61aaae74779ebcd91ca8f2bbc2c.tar.xz |
unittest: Cleanup unit tests. Follow style. Garbage Collect.
--HG--
rename : src/unittest/rangemaptest2.cc => src/unittest/rangemultimaptest.cc
Diffstat (limited to 'src/unittest/circletest.cc')
-rw-r--r-- | src/unittest/circletest.cc | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/src/unittest/circletest.cc b/src/unittest/circletest.cc index f072cf044..c6fce0f8f 100644 --- a/src/unittest/circletest.cc +++ b/src/unittest/circletest.cc @@ -34,14 +34,15 @@ #include "base/circlebuf.hh" -char *strings[] = -{ "This is the first test\n", - "he went with his woman to the store\n", - "the man with the bat hit the woman with the hat\n", - "that that is is that that was\n", - "sue sells sea shells by the sea shore\n", - "go to the store and buy me some milk and bread\n", - "the friendly flight attendants spoke soothingly to the frightened passengers in their native languages\n" +char *strings[] = { + "This is the first test\n", + "he went with his woman to the store\n", + "the man with the bat hit the woman with the hat\n", + "that that is is that that was\n", + "sue sells sea shells by the sea shore\n", + "go to the store and buy me some milk and bread\n", + "the friendly flight attendants spoke soothingly to " + "the frightened passengers in their native languages\n" }; const int num_strings = sizeof(strings) / sizeof(char *); @@ -49,26 +50,26 @@ const int num_strings = sizeof(strings) / sizeof(char *); int main() { - CircleBuf buf(1024); + CircleBuf buf(1024); - for (int count = 0; count < 100; count++) - buf.write(strings[count % num_strings]); - buf.read(STDOUT_FILENO); - write(STDOUT_FILENO, "<\n", 2); + for (int count = 0; count < 100; count++) + buf.write(strings[count % num_strings]); + buf.read(STDOUT_FILENO); + write(STDOUT_FILENO, "<\n", 2); - for (int count = 0; count < 100; count++) - buf.write(strings[count % num_strings]); - buf.read(STDOUT_FILENO, 100); - write(STDOUT_FILENO, "<\n", 2); + for (int count = 0; count < 100; count++) + buf.write(strings[count % num_strings]); + buf.read(STDOUT_FILENO, 100); + write(STDOUT_FILENO, "<\n", 2); - buf.flush(); - buf.write("asdfa asdf asd fasdf asdf\n"); - buf.write(""); - buf.write(""); - buf.write(""); - buf.write(""); - buf.write(""); - buf.write(""); - buf.read(STDOUT_FILENO); - write(STDOUT_FILENO, "<\n", 2); + buf.flush(); + buf.write("asdfa asdf asd fasdf asdf\n"); + buf.write(""); + buf.write(""); + buf.write(""); + buf.write(""); + buf.write(""); + buf.write(""); + buf.read(STDOUT_FILENO); + write(STDOUT_FILENO, "<\n", 2); } |