Value-parameterized tests and many bugfixes

This commit is contained in:
vladlosev
2008-11-20 01:40:35 +00:00
parent b6a296d0f7
commit 3d70421763
36 changed files with 10345 additions and 194 deletions

View File

@@ -33,13 +33,15 @@
#include "sample2.h"
#include <string.h>
// Clones a 0-terminated C string, allocating memory using new.
const char * MyString::CloneCString(const char * c_string) {
if (c_string == NULL) return NULL;
const size_t len = strlen(c_string);
char * const clone = new char[ len + 1 ];
strcpy(clone, c_string);
memcpy(clone, c_string, len + 1);
return clone;
}