From a3b4058bf7266f1291cf38c30425d9948250fcd9 Mon Sep 17 00:00:00 2001 From: Branimir Karadžić Date: Sat, 29 Oct 2016 09:11:50 +0200 Subject: Updated BGFX and BX and recompiled shaders (nw) --- 3rdparty/bx/tests/string_test.cpp | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 3rdparty/bx/tests/string_test.cpp (limited to '3rdparty/bx/tests/string_test.cpp') diff --git a/3rdparty/bx/tests/string_test.cpp b/3rdparty/bx/tests/string_test.cpp new file mode 100644 index 00000000000..3d98e38b2e8 --- /dev/null +++ b/3rdparty/bx/tests/string_test.cpp @@ -0,0 +1,41 @@ +/* + * Copyright 2010-2016 Branimir Karadzic. All rights reserved. + * License: https://github.com/bkaradzic/bx#license-bsd-2-clause + */ + +#include "test.h" +#include +#include +#include + +bx::AllocatorI* g_allocator; + +TEST_CASE("strnlen", "") +{ + const char* test = "test"; + + REQUIRE(0 == bx::strnlen(test, 0) ); + REQUIRE(2 == bx::strnlen(test, 2) ); + REQUIRE(4 == bx::strnlen(test, UINT32_MAX) ); +} + +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() ); +} -- cgit v1.2.3-70-g09d2