1 //:
2 // \file
3 // \author Vishal Jain
4 // \date June 9, 2013
5 #include <iostream>
6 #include <cstdio>
7 #include <boxm2/boxm2_scene.h>
8 #include <boxm2/boxm2_block.h>
9 #include <boxm2/basic/boxm2_block_id.h>
10 #include <boxm2/io/boxm2_lru_cache.h>
11 #include <boxm2/io/boxm2_cache.h>
12 #include <boxm2/io/boxm2_sio_mgr.h>
13 #include "testlib/testlib_test.h"
14 #include "testlib/testlib_root_dir.h"
15 #include "test_utils.h"
16
17 // for stats
18 #include "vul/vul_timer.h"
19 #include <vcl_sys/time.h>
20 #ifdef _MSC_VER
21 # include "vcl_msvc_warnings.h"
22 #endif
23 //#include <unistd.h>
24
test_lru_cache2()25 void test_lru_cache2()
26 {
27 //init cache
28 boxm2_scene_sptr scene1,scene2;
29 boxm2_test_utils::create_test_simple_scene(scene1);
30 boxm2_test_utils::create_test_simple_scene(scene2);
31 boxm2_lru_cache::create(scene1);
32 boxm2_cache_sptr cache = boxm2_cache::instance();
33 //simulate a render
34 std::cout<<"loading initial BLOCK and ALPHA"<<std::endl;
35 boxm2_block* blk1 = cache->get_block(scene1, boxm2_block_id(0,0,0));
36 boxm2_block* blk2 = cache->get_block(scene2, boxm2_block_id(0,0,0));
37
38 TEST("checking Scene 1 block id",blk1->block_id(), boxm2_block_id(0,0,0) );
39 TEST("checking Scene 2 block id",blk2->block_id(), boxm2_block_id(0,0,0) );
40
41
42 }
43
44
45
46
test_cache2()47 void test_cache2()
48 {
49 test_lru_cache2();
50 }
51
52
53 TESTMAIN(test_cache2);
54