Ignore:
Timestamp:
08/25/14 02:43:30 (11 years ago)
Author:
epyon
Message:
  • updated all tests to new nova
  • cleaned up tests paths
  • general cleanup of tests and test data
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/gui_test/nv_gui_test.cc

    r319 r321  
    44#include <nv/core/logging.hh>
    55#include <nv/core/logger.hh>
    6 #include <cstdlib> // rand
    7 #include <ctime> // time
     6#include <nv/core/random.hh>
    87
    98class application
     
    8483void application::spawn_window()
    8584{
    86         glm::ivec2 a( std::rand() % 600, std::rand() % 400 );
    87         glm::ivec2 b( std::rand() % 200 + 40, std::rand() % 200 + 40 );
     85        nv::ivec2 a = nv::random::get().range( nv::ivec2(), nv::ivec2( 600, 400 ) );
     86        nv::ivec2 b = nv::random::get().range( nv::ivec2( 40, 40 ), nv::ivec2( 240, 240 ) );
    8887        nv::gui::handle e = m_guienv->create_element( nv::rectangle(a).dim(b) );
    8988        m_guienv->set_class( e, "window" );
     
    9695{
    9796        if ( m_windows.size() == 0 ) return;
    98         size_t index = rand() % m_windows.size();
     97        size_t index = nv::random::get().urand( m_windows.size() );
    9998        m_guienv->destroy_element( m_windows[index] );
    10099        m_windows.erase( m_windows.begin() + index );
     
    118117int main(int, char* [])
    119118{
    120         std::srand((unsigned int) std::time(0) );
     119        nv::random::get().randomize();
    121120        nv::logger log(nv::LOG_TRACE);
    122121        log.add_sink( new nv::log_file_sink("log.txt"), nv::LOG_TRACE );
Note: See TracChangeset for help on using the changeset viewer.