test/TestUtils.h
author Jens Alfke <jens@mooseyard.com>
Sun Sep 20 15:14:12 2009 -0700 (2009-09-20)
changeset 0 31a43d94cc26
permissions -rw-r--r--
First official checkin.
     1 /*
     2  *  TestUtils.h
     3  *  Ottoman
     4  *
     5  *  Created by Jens Alfke on 9/2/09.
     6  *  Copyright 2009 Jens Alfke. All rights reserved.
     7  *  BSD-Licensed: See the file "LICENSE.txt" for details.
     8  */
     9 
    10 #include <gtest/gtest.h>    // Get gtest from <http://code.google.com/p/googletest/>
    11 #include <iosfwd>
    12 #include "Base.h"
    13 
    14 namespace Mooseyard {
    15 
    16     std::ostream& operator<< (std::ostream &out, const Blob&);
    17 
    18     void shuffle(int a[], int n, unsigned seed =0);
    19     
    20     extern char **sWords;
    21     extern int sNWords;
    22     
    23     void readWords();
    24         
    25     class Timer {
    26     public:
    27         Timer (const char *operation, int divisor =1);
    28         ~Timer();
    29         double elapsed()                                    {return now() - _time;}
    30         static double now();
    31     private:
    32         const char *_operation;
    33         int _divisor;
    34         double _cpuTime, _time;
    35     };
    36     
    37 }