Added HandleHashMap.

This commit is contained in:
Branimir Karadžić
2016-09-05 20:55:30 -07:00
parent ef5a01f0ea
commit 5fe975a39b
26 changed files with 752 additions and 81 deletions

32
tests/string_test.cpp Normal file
View File

@@ -0,0 +1,32 @@
/*
* Copyright 2010-2016 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bx#license-bsd-2-clause
*/
#include "test.h"
#include <bx/string.h>
#include <bx/crtimpl.h>
#include <bx/handlealloc.h>
bx::AllocatorI* g_allocator;
TEST_CASE("StringView", "")
{
bx::StringView sv("test");
REQUIRE(4 == sv.getLength() );
bx::CrtAllocator crt;
g_allocator = &crt;
typedef bx::StringT<&g_allocator> String;
String st(sv);
REQUIRE(4 == st.getLength() );
st.clear();
REQUIRE(0 == st.getLength() );
REQUIRE(4 == sv.getLength() );
sv.clear();
REQUIRE(0 == sv.getLength() );
}