24 lines
567 B
C++
24 lines
567 B
C++
|
#include <cxxtest/TestSuite.h>
|
||
|
|
||
|
#include "posutil.hh"
|
||
|
|
||
|
class PosUtil_test: public CxxTest::TestSuite
|
||
|
{
|
||
|
public:
|
||
|
|
||
|
void test_wifi(void)
|
||
|
{
|
||
|
// Bad values
|
||
|
TS_ASSERT_EQUALS(PosUtil::channel_to_frequency(0),
|
||
|
static_cast<unsigned int>(0)) ;
|
||
|
TS_ASSERT_EQUALS(PosUtil::channel_to_frequency(15),
|
||
|
static_cast<unsigned int>(0)) ;
|
||
|
|
||
|
// Good values
|
||
|
for (unsigned int i = 1 ; i < 15 ; ++i)
|
||
|
TS_ASSERT(PosUtil::channel_to_frequency(i) >= 2412 &&
|
||
|
PosUtil::channel_to_frequency(i) <= 2477) ;
|
||
|
}
|
||
|
|
||
|
} ;
|