Index: trunk/tests/cachebuf_test/cachebuf_test.lua
===================================================================
--- trunk/tests/cachebuf_test/cachebuf_test.lua	(revision 319)
+++ trunk/tests/cachebuf_test/cachebuf_test.lua	(revision 321)
@@ -3,5 +3,6 @@
 	files { "nv_cachebuf_test.cc" }
 	includedirs { "../../" }
-	targetname "nv_gui_test"
-	links { "nv" }
+	links { "nv-core", "nv-gl", "nv-gfx" }
+	targetdir "../../bin"
+	targetname "nv_cachebuf_test"
  
Index: trunk/tests/cachebuf_test/nv_cachebuf_test.cc
===================================================================
--- trunk/tests/cachebuf_test/nv_cachebuf_test.cc	(revision 319)
+++ trunk/tests/cachebuf_test/nv_cachebuf_test.cc	(revision 321)
@@ -5,11 +5,6 @@
 #include <nv/core/logging.hh>
 #include <nv/core/logger.hh>
-#include <glm/glm.hpp>
-#include <glm/gtc/matrix_transform.hpp>
-#include <glm/gtc/type_ptr.hpp>
 #include <nv/core/string.hh>
-#include <cstdlib> // rand
-#include <ctime> // time
-
+#include <nv/core/random.hh>
 #include <nv/gfx/sliced_buffer.hh>
 
@@ -259,5 +254,5 @@
 		nv::buffer buffer = m_quad_cache->get_vertex_buffer();
 		#else
-		m_quad_cache = new gcache( m_context, nv::DYNAMIC_DRAW, 20, true );
+		m_quad_cache = new gcache( m_context, nv::VERTEX_BUFFER, nv::DYNAMIC_DRAW, 20 );
 		nv::buffer buffer = m_quad_cache->get_buffer();
 		#endif
@@ -286,11 +281,12 @@
 			m_context->set_index_buffer( m_va, m_quad_cache->get_index_buffer(), nv::USHORT, false );
 			nv::buffer buffer = m_quad_cache->get_vertex_buffer();
+			m_context->replace_vertex_buffer( m_va, buffer, nv::slot::POSITION, false );
 			#else
 			nv::buffer buffer = m_quad_cache->get_buffer();
+			m_context->replace_vertex_buffer( m_va, buffer, false );
 			#endif
 		}
 
 		m_window->get_context()->clear( m_clear_state );
-//		m_program->set_uniform( "tex", 0 );
 		#ifdef INDEXED_TEST
 		size_t draw_size = m_quad_cache->get_index_size();
@@ -330,6 +326,6 @@
 void application::spawn_window()
 {
-	glm::ivec2 a( std::rand() % 600, std::rand() % 400 );
-	glm::ivec2 b( std::rand() % 200, std::rand() % 200 );
+	glm::ivec2 a = nv::random::get().range( nv::ivec2(), nv::ivec2( 600, 400 ) );
+	glm::ivec2 b = nv::random::get().range( nv::ivec2(), nv::ivec2( 200, 200 ) );
 	NV_LOG( nv::LOG_INFO, "Spawn (" << a.x << "," << a.y << "x" << b.x << "," << b.y << ")" );
 	m_windows.emplace_back( m_quad_cache, a, a + b, glm::vec4( 0, 0, 1, 1 ) );
@@ -339,5 +335,5 @@
 {
 	if ( m_windows.size() == 0 ) return;
-	size_t index = rand() % m_windows.size();
+	size_t index = nv::random::get().urand( m_windows.size() );
 	m_windows.erase( m_windows.begin() + index );
 }
@@ -346,5 +342,5 @@
 {
 	if ( m_windows.size() == 0 ) return;
-	size_t index = rand() % m_windows.size();
+	size_t index = nv::random::get().urand( m_windows.size() );
 	m_windows[ index ].change_color( nv::vec4( (float)rand() / float(RAND_MAX), (float)rand() / float(RAND_MAX), (float)rand() / float(RAND_MAX), 1.0 ) );
 }
@@ -353,5 +349,5 @@
 {
 	if ( m_windows.size() == 0 ) return;
-	size_t index = rand() % m_windows.size();
+	size_t index = nv::random::get().urand( m_windows.size() );
 	NV_LOG( nv::LOG_INFO, "Simplify " << index );
 	m_windows[ index ].simplify_toggle();
@@ -372,5 +368,5 @@
 int main(int, char* [])
 {
-	std::srand((unsigned int) std::time(0) );
+	nv::random::get().randomize();
 	nv::logger log(nv::LOG_TRACE);
 	log.add_sink( new nv::log_file_sink("log.txt"), nv::LOG_TRACE );
Index: trunk/tests/cachebuf_test/premake4.lua
===================================================================
--- trunk/tests/cachebuf_test/premake4.lua	(revision 319)
+++ trunk/tests/cachebuf_test/premake4.lua	(revision 321)
@@ -5,23 +5,15 @@
 	flags { "ExtraWarnings", "NoPCH" }
 
-	configuration "gmake"	
-		buildoptions "-std=c++11"
-
 	configuration "debug"
 		defines { "DEBUG" }
 		flags { "Symbols", "StaticRuntime" }
-		objdir (_ACTION.."/debug")
+		objdir ("../../".._ACTION.."/debug")
 
 	configuration "release"
 		defines { "NDEBUG" }
 		flags { "Optimize", "StaticRuntime" }
-		objdir (_ACTION.."/release")
+		objdir ("../../".._ACTION.."/release")
 
 	dofile("cachebuf_test.lua")
 	dofile("../../nv.lua")
 
-if _ACTION == "clean" then
-	for action in premake.action.each() do
-		os.rmdir(action.trigger)
-	end
-end
