summaryrefslogtreecommitdiff
path: root/tests/t0004-vector.c
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-02-02 02:15:25 +0200
committerVicent Marti <tanoku@gmail.com>2011-02-02 02:15:25 +0200
commit2a1732b43904d67cfeb301a5287b13c5893f9b64 (patch)
treed5560b1826b3f8369aebc0ed3d887d556f245e8f /tests/t0004-vector.c
parentb70e4f8a0391a8ec9bcc2ba06a30cc4889e93191 (diff)
downloadlibgit2-2a1732b43904d67cfeb301a5287b13c5893f9b64.tar.gz
Rewrite the unit testing suite
NIH Enterprises presents: a new testing system based on CuTesT, which is faster than our previous one and fortunately uses no preprocessing on the source files, which means we can run that from CMake. The test suites have been gathered together into bigger files (one file per suite, testing each of the different submodules of the library). Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'tests/t0004-vector.c')
-rw-r--r--tests/t0004-vector.c27
1 files changed, 0 insertions, 27 deletions
diff --git a/tests/t0004-vector.c b/tests/t0004-vector.c
deleted file mode 100644
index bee71d2f2..000000000
--- a/tests/t0004-vector.c
+++ /dev/null
@@ -1,27 +0,0 @@
-#include "test_lib.h"
-#include "common.h"
-#include "vector.h"
-
-/* Initial size of 1 will cause writing past array bounds prior to fix */
-BEGIN_TEST(initial_size_one)
- git_vector x;
- int i;
- git_vector_init(&x, 1, NULL, NULL);
- for (i = 0; i < 10; ++i) {
- git_vector_insert(&x, (void*) 0xabc);
- }
- git_vector_free(&x);
-END_TEST
-
-/* vector used to read past array bounds on remove() */
-BEGIN_TEST(remove)
- git_vector x;
- // make initial capacity exact for our insertions.
- git_vector_init(&x, 3, NULL, NULL);
- git_vector_insert(&x, (void*) 0xabc);
- git_vector_insert(&x, (void*) 0xdef);
- git_vector_insert(&x, (void*) 0x123);
-
- git_vector_remove(&x, 0); // used to read past array bounds.
- git_vector_free(&x);
-END_TEST