Stun Server  Compliant with the latest RFCs including 5389, 5769, and 5780
discover the local host's own external IP address
testfasthash.h
Go to the documentation of this file.
1 /*
2  Copyright 2011 John Selbie
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 */
16 
17 #ifndef TEST_FAST_HASH_H
18 #define TEST_FAST_HASH_H
19 
20 #include "fasthash.h"
21 #include "unittest.h"
22 
23 
24 
25 
26 class CTestFastHash : public IUnitTest
27 {
28 private:
29 
30  struct Item
31  {
32  int key;
33  };
34 
35  static const size_t c_maxsize = 500;
36  static const size_t c_tablesize = 91;
37 
39 
40  HRESULT AddRangeToSet(int first, int last);
41  HRESULT RemoveRangeFromSet(int first, int last);
42  HRESULT ValidateRangeInSet(int first, int last);
43  HRESULT ValidateRangeNotInSet(int first, int last);
44  HRESULT AddOne(int val);
45  HRESULT RemoveOne(int val);
46  HRESULT ValidateRangeInIndex(int first, int last);
47 
48 
49 
52 
54 
55 
56 public:
57  virtual HRESULT Run();
58  UT_DECLARE_TEST_NAME("CTestFastHash");
59 };
60 
61 #endif
HRESULT ValidateRangeInIndex(int first, int last)
HRESULT AddRangeToSet(int first, int last)
FastHash< int, Item, c_maxsize, c_tablesize > _hashtable
Definition: testfasthash.h:38
UT_DECLARE_TEST_NAME("CTestFastHash")
HRESULT RemoveOne(int val)
HRESULT RemoveRangeFromSet(int first, int last)
static const size_t c_maxsize
Definition: testfasthash.h:35
static const size_t c_tablesize
Definition: testfasthash.h:36
HRESULT TestIndexing()
int32_t HRESULT
Definition: hresult.h:22
HRESULT TestFastHash()
virtual HRESULT Run()
HRESULT TestRemove()
HRESULT ValidateRangeInSet(int first, int last)
HRESULT ValidateRangeNotInSet(int first, int last)
HRESULT AddOne(int val)