OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2009 CTTC | 3 * Copyright (c) 2009 CTTC |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 if (payloadMode.GetModulationClass () == WIFI_MOD_CLASS_HT || payloadMode.GetM
odulationClass () == WIFI_MOD_CLASS_HE) | 122 if (payloadMode.GetModulationClass () == WIFI_MOD_CLASS_HT || payloadMode.GetM
odulationClass () == WIFI_MOD_CLASS_HE) |
123 { | 123 { |
124 //Durations vary depending on frequency; test also 2.4 GHz (bug 1971) | 124 //Durations vary depending on frequency; test also 2.4 GHz (bug 1971) |
125 testedFrequency = CHANNEL_1_MHZ; | 125 testedFrequency = CHANNEL_1_MHZ; |
126 calculatedDuration = phy->GetPayloadDuration (size, txVector, testedFreque
ncy); | 126 calculatedDuration = phy->GetPayloadDuration (size, txVector, testedFreque
ncy); |
127 knownDuration += MicroSeconds (6); | 127 knownDuration += MicroSeconds (6); |
128 if (calculatedDuration != knownDuration) | 128 if (calculatedDuration != knownDuration) |
129 { | 129 { |
130 std::cerr << "size=" << size | 130 std::cerr << "size=" << size |
131 << " mode=" << payloadMode | 131 << " mode=" << payloadMode |
132 << " channelWidth=" << static_cast<uint16_t> (channelWidth) | 132 << " channelWidth=" << channelWidth |
133 << " guardInterval=" << guardInterval | 133 << " guardInterval=" << guardInterval |
134 << " datarate=" << payloadMode.GetDataRate (channelWidth, gu
ardInterval, 1) | 134 << " datarate=" << payloadMode.GetDataRate (channelWidth, gu
ardInterval, 1) |
135 << " known=" << knownDuration | 135 << " known=" << knownDuration |
136 << " calculated=" << calculatedDuration | 136 << " calculated=" << calculatedDuration |
137 << std::endl; | 137 << std::endl; |
138 return false; | 138 return false; |
139 } | 139 } |
140 } | 140 } |
141 return true; | 141 return true; |
142 } | 142 } |
(...skipping 16 matching lines...) Expand all Loading... |
159 || payloadMode.GetModulationClass () == WIFI_MOD_CLASS_VHT | 159 || payloadMode.GetModulationClass () == WIFI_MOD_CLASS_VHT |
160 || payloadMode.GetModulationClass () == WIFI_MOD_CLASS_HE) | 160 || payloadMode.GetModulationClass () == WIFI_MOD_CLASS_HE) |
161 { | 161 { |
162 testedFrequency = CHANNEL_36_MHZ; | 162 testedFrequency = CHANNEL_36_MHZ; |
163 } | 163 } |
164 Time calculatedDuration = phy->CalculateTxDuration (size, txVector, testedFreq
uency); | 164 Time calculatedDuration = phy->CalculateTxDuration (size, txVector, testedFreq
uency); |
165 if (calculatedDuration != knownDuration) | 165 if (calculatedDuration != knownDuration) |
166 { | 166 { |
167 std::cerr << "size=" << size | 167 std::cerr << "size=" << size |
168 << " mode=" << payloadMode | 168 << " mode=" << payloadMode |
169 << " channelWidth=" << static_cast<uint16_t> (channelWidth) | 169 << " channelWidth=" << channelWidth |
170 << " guardInterval=" << guardInterval | 170 << " guardInterval=" << guardInterval |
171 << " datarate=" << payloadMode.GetDataRate (channelWidth, guardI
nterval, 1) | 171 << " datarate=" << payloadMode.GetDataRate (channelWidth, guardI
nterval, 1) |
172 << " preamble=" << preamble | 172 << " preamble=" << preamble |
173 << " known=" << knownDuration | 173 << " known=" << knownDuration |
174 << " calculated=" << calculatedDuration | 174 << " calculated=" << calculatedDuration |
175 << std::endl; | 175 << std::endl; |
176 return false; | 176 return false; |
177 } | 177 } |
178 if (payloadMode.GetModulationClass () == WIFI_MOD_CLASS_HT || payloadMode.GetM
odulationClass () == WIFI_MOD_CLASS_HE) | 178 if (payloadMode.GetModulationClass () == WIFI_MOD_CLASS_HT || payloadMode.GetM
odulationClass () == WIFI_MOD_CLASS_HE) |
179 { | 179 { |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 TxDurationTestSuite (); | 438 TxDurationTestSuite (); |
439 }; | 439 }; |
440 | 440 |
441 TxDurationTestSuite::TxDurationTestSuite () | 441 TxDurationTestSuite::TxDurationTestSuite () |
442 : TestSuite ("devices-wifi-tx-duration", UNIT) | 442 : TestSuite ("devices-wifi-tx-duration", UNIT) |
443 { | 443 { |
444 AddTestCase (new TxDurationTest, TestCase::QUICK); | 444 AddTestCase (new TxDurationTest, TestCase::QUICK); |
445 } | 445 } |
446 | 446 |
447 static TxDurationTestSuite g_txDurationTestSuite; ///< the test suite | 447 static TxDurationTestSuite g_txDurationTestSuite; ///< the test suite |
OLD | NEW |