diff options
| author | David M. Syzdek <david@syzdek.net> | 2022-02-11 15:00:01 -0900 |
|---|---|---|
| committer | David M. Syzdek <david@syzdek.net> | 2022-02-11 15:01:45 -0900 |
| commit | 602aff660eaec0deb7364417acaa0e58e23884df (patch) | |
| tree | 830f5e76a81172e748deaee0e8281d7aa4c2ad76 /tests | |
| parent | ba2d22f2a098f7c402607dd3ce7172310457a9ee (diff) | |
| download | tinyrad-602aff660eaec0deb7364417acaa0e58e23884df.tar.gz tinyrad-602aff660eaec0deb7364417acaa0e58e23884df.tar.bz2 tinyrad-602aff660eaec0deb7364417acaa0e58e23884df.tar.xz tinyrad-602aff660eaec0deb7364417acaa0e58e23884df.zip | |
tests: renaming 'def' to 'vendor_def'
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/dict-data.c | 12 | ||||
| -rw-r--r-- | tests/dict-data.h | 2 | ||||
| -rw-r--r-- | tests/test-dict-vendors.c | 54 |
3 files changed, 34 insertions, 34 deletions
diff --git a/tests/dict-data.c b/tests/dict-data.c index 9a788a8..7b280ee 100644 --- a/tests/dict-data.c +++ b/tests/dict-data.c | |||
| @@ -261,7 +261,7 @@ our_dict_diag_value( | |||
| 261 | void | 261 | void |
| 262 | our_dict_diag_vendor( | 262 | our_dict_diag_vendor( |
| 263 | unsigned opts, | 263 | unsigned opts, |
| 264 | const TinyRadDictVendorDef * def, | 264 | const TinyRadDictVendorDef * vendor_def, |
| 265 | TinyRadDictVendor * vendor ) | 265 | TinyRadDictVendor * vendor ) |
| 266 | { | 266 | { |
| 267 | char * vendor_name; | 267 | char * vendor_name; |
| @@ -270,13 +270,13 @@ our_dict_diag_vendor( | |||
| 270 | uint32_t vendor_id; | 270 | uint32_t vendor_id; |
| 271 | unsigned vendor_ref_count; | 271 | unsigned vendor_ref_count; |
| 272 | 272 | ||
| 273 | if ((def)) | 273 | if ((vendor_def)) |
| 274 | { | 274 | { |
| 275 | our_verbose(opts, "Vendor Definition"); | 275 | our_verbose(opts, "Vendor Definition"); |
| 276 | our_verbose(opts, " Name: %s", def->name); | 276 | our_verbose(opts, " Name: %s", vendor_def->name); |
| 277 | our_verbose(opts, " Vendor ID: %" PRIu32, def->vendor_id); | 277 | our_verbose(opts, " Vendor ID: %" PRIu32, vendor_def->vendor_id); |
| 278 | our_verbose(opts, " Vendor Type: %" PRIu32, def->vendor_type_octs); | 278 | our_verbose(opts, " Vendor Type: %" PRIu32, vendor_def->vendor_type_octs); |
| 279 | our_verbose(opts, " Data Type: %" PRIu32, def->vendor_len_octs); | 279 | our_verbose(opts, " Data Type: %" PRIu32, vendor_def->vendor_len_octs); |
| 280 | }; | 280 | }; |
| 281 | 281 | ||
| 282 | if ((vendor)) | 282 | if ((vendor)) |
diff --git a/tests/dict-data.h b/tests/dict-data.h index a531a18..983580e 100644 --- a/tests/dict-data.h +++ b/tests/dict-data.h | |||
| @@ -94,7 +94,7 @@ our_dict_diag_value( | |||
| 94 | void | 94 | void |
| 95 | our_dict_diag_vendor( | 95 | our_dict_diag_vendor( |
| 96 | unsigned opts, | 96 | unsigned opts, |
| 97 | const TinyRadDictVendorDef * def, | 97 | const TinyRadDictVendorDef * vendor_def, |
| 98 | TinyRadDictVendor * vendor ); | 98 | TinyRadDictVendor * vendor ); |
| 99 | 99 | ||
| 100 | 100 | ||
diff --git a/tests/test-dict-vendors.c b/tests/test-dict-vendors.c index c7627f7..8cb2e7b 100644 --- a/tests/test-dict-vendors.c +++ b/tests/test-dict-vendors.c | |||
| @@ -80,7 +80,7 @@ main( | |||
| 80 | int | 80 | int |
| 81 | my_verify_vendor( | 81 | my_verify_vendor( |
| 82 | unsigned opts, | 82 | unsigned opts, |
| 83 | const TinyRadDictVendorDef * def, | 83 | const TinyRadDictVendorDef * vendor_def, |
| 84 | TinyRadDictVendor * vendor ); | 84 | TinyRadDictVendor * vendor ); |
| 85 | 85 | ||
| 86 | 86 | ||
| @@ -103,7 +103,7 @@ main( | |||
| 103 | unsigned opts; | 103 | unsigned opts; |
| 104 | TinyRadDict * dict; | 104 | TinyRadDict * dict; |
| 105 | TinyRadDictVendor * vendor; | 105 | TinyRadDictVendor * vendor; |
| 106 | const TinyRadDictVendorDef * def; | 106 | const TinyRadDictVendorDef * vendor_def; |
| 107 | 107 | ||
| 108 | // getopt options | 108 | // getopt options |
| 109 | static char short_opt[] = "dhVvq"; | 109 | static char short_opt[] = "dhVvq"; |
| @@ -180,10 +180,10 @@ main( | |||
| 180 | // verifies default attributes in dictionary by name | 180 | // verifies default attributes in dictionary by name |
| 181 | for(pos = 0; ((tinyrad_dict_default_vendors[pos].name)); pos++) | 181 | for(pos = 0; ((tinyrad_dict_default_vendors[pos].name)); pos++) |
| 182 | { | 182 | { |
| 183 | def = &tinyrad_dict_default_vendors[pos]; | 183 | vendor_def = &tinyrad_dict_default_vendors[pos]; |
| 184 | our_verbose( opts, "default attribute search by name %8" PRIu32 " %s ...", def->vendor_id, def->name); | 184 | our_verbose( opts, "default attribute search by name %8" PRIu32 " %s ...", vendor_def->vendor_id, vendor_def->name); |
| 185 | vendor = tinyrad_dict_vendor_get(dict, def->name, 0); | 185 | vendor = tinyrad_dict_vendor_get(dict, vendor_def->name, 0); |
| 186 | if ((my_verify_vendor(opts, def, vendor))) | 186 | if ((my_verify_vendor(opts, vendor_def, vendor))) |
| 187 | { | 187 | { |
| 188 | tinyrad_free(vendor); | 188 | tinyrad_free(vendor); |
| 189 | tinyrad_free(dict); | 189 | tinyrad_free(dict); |
| @@ -194,10 +194,10 @@ main( | |||
| 194 | // verifies test attributes in dictionary by type | 194 | // verifies test attributes in dictionary by type |
| 195 | for(pos = 0; ((tinyrad_dict_default_vendors[pos].name)); pos++) | 195 | for(pos = 0; ((tinyrad_dict_default_vendors[pos].name)); pos++) |
| 196 | { | 196 | { |
| 197 | def = &tinyrad_dict_default_vendors[pos]; | 197 | vendor_def = &tinyrad_dict_default_vendors[pos]; |
| 198 | our_verbose( opts, "default attribute search by id %8" PRIu32 " %s ...", def->vendor_id, def->name); | 198 | our_verbose( opts, "default attribute search by id %8" PRIu32 " %s ...", vendor_def->vendor_id, vendor_def->name); |
| 199 | vendor = tinyrad_dict_vendor_get(dict, NULL, (uint32_t)def->vendor_id); | 199 | vendor = tinyrad_dict_vendor_get(dict, NULL, (uint32_t)vendor_def->vendor_id); |
| 200 | if ((my_verify_vendor(opts, def, vendor))) | 200 | if ((my_verify_vendor(opts, vendor_def, vendor))) |
| 201 | { | 201 | { |
| 202 | tinyrad_free(vendor); | 202 | tinyrad_free(vendor); |
| 203 | tinyrad_free(dict); | 203 | tinyrad_free(dict); |
| @@ -208,10 +208,10 @@ main( | |||
| 208 | // verifies test attributes in dictionary by name | 208 | // verifies test attributes in dictionary by name |
| 209 | for(pos = 0; ((test_dict_data_vendors[pos].name)); pos++) | 209 | for(pos = 0; ((test_dict_data_vendors[pos].name)); pos++) |
| 210 | { | 210 | { |
| 211 | def = &test_dict_data_vendors[pos]; | 211 | vendor_def = &test_dict_data_vendors[pos]; |
| 212 | our_verbose( opts, "test attribute search by name %8" PRIu32 " %s ...", def->vendor_id, def->name); | 212 | our_verbose( opts, "test attribute search by name %8" PRIu32 " %s ...", vendor_def->vendor_id, vendor_def->name); |
| 213 | vendor = tinyrad_dict_vendor_get(dict, def->name, 0); | 213 | vendor = tinyrad_dict_vendor_get(dict, vendor_def->name, 0); |
| 214 | if ((my_verify_vendor(opts, def, vendor))) | 214 | if ((my_verify_vendor(opts, vendor_def, vendor))) |
| 215 | { | 215 | { |
| 216 | tinyrad_free(vendor); | 216 | tinyrad_free(vendor); |
| 217 | tinyrad_free(dict); | 217 | tinyrad_free(dict); |
| @@ -222,10 +222,10 @@ main( | |||
| 222 | // verifies default attributes in dictionary by type | 222 | // verifies default attributes in dictionary by type |
| 223 | for(pos = 0; ((test_dict_data_vendors[pos].name)); pos++) | 223 | for(pos = 0; ((test_dict_data_vendors[pos].name)); pos++) |
| 224 | { | 224 | { |
| 225 | def = &test_dict_data_vendors[pos]; | 225 | vendor_def = &test_dict_data_vendors[pos]; |
| 226 | our_verbose( opts, "test attribute search by id %8" PRIu32 " %s ...", def->vendor_id, def->name); | 226 | our_verbose( opts, "test attribute search by id %8" PRIu32 " %s ...", vendor_def->vendor_id, vendor_def->name); |
| 227 | vendor = tinyrad_dict_vendor_get(dict, NULL, (uint32_t)def->vendor_id); | 227 | vendor = tinyrad_dict_vendor_get(dict, NULL, (uint32_t)vendor_def->vendor_id); |
| 228 | if ((my_verify_vendor(opts, def, vendor))) | 228 | if ((my_verify_vendor(opts, vendor_def, vendor))) |
| 229 | { | 229 | { |
| 230 | tinyrad_free(vendor); | 230 | tinyrad_free(vendor); |
| 231 | tinyrad_free(dict); | 231 | tinyrad_free(dict); |
| @@ -243,41 +243,41 @@ main( | |||
| 243 | int | 243 | int |
| 244 | my_verify_vendor( | 244 | my_verify_vendor( |
| 245 | unsigned opts, | 245 | unsigned opts, |
| 246 | const TinyRadDictVendorDef * def, | 246 | const TinyRadDictVendorDef * vendor_def, |
| 247 | TinyRadDictVendor * vendor ) | 247 | TinyRadDictVendor * vendor ) |
| 248 | { | 248 | { |
| 249 | uint8_t u8; | 249 | uint8_t u8; |
| 250 | uint32_t u32; | 250 | uint32_t u32; |
| 251 | 251 | ||
| 252 | assert(def != NULL); | 252 | assert(vendor_def != NULL); |
| 253 | 253 | ||
| 254 | if (!(vendor)) | 254 | if (!(vendor)) |
| 255 | { | 255 | { |
| 256 | our_dict_diag_vendor(opts, def, NULL); | 256 | our_dict_diag_vendor(opts, vendor_def, NULL); |
| 257 | return(our_error(opts, NULL, "vendor was not found")); | 257 | return(our_error(opts, NULL, "vendor was not found")); |
| 258 | }; | 258 | }; |
| 259 | 259 | ||
| 260 | // compare vendor ID | 260 | // compare vendor ID |
| 261 | tinyrad_dict_vendor_info(vendor, TRAD_DICT_OPT_VEND_ID, &u32); | 261 | tinyrad_dict_vendor_info(vendor, TRAD_DICT_OPT_VEND_ID, &u32); |
| 262 | if (def->vendor_id != u32) | 262 | if (vendor_def->vendor_id != u32) |
| 263 | { | 263 | { |
| 264 | our_dict_diag_vendor(opts, def, vendor); | 264 | our_dict_diag_vendor(opts, vendor_def, vendor); |
| 265 | return(our_error(opts, NULL, "vendor ID do not match")); | 265 | return(our_error(opts, NULL, "vendor ID do not match")); |
| 266 | }; | 266 | }; |
| 267 | 267 | ||
| 268 | // compare vendor type octets | 268 | // compare vendor type octets |
| 269 | tinyrad_dict_vendor_info(vendor, TRAD_DICT_OPT_TYPE_OCTS, &u8); | 269 | tinyrad_dict_vendor_info(vendor, TRAD_DICT_OPT_TYPE_OCTS, &u8); |
| 270 | if (def->vendor_type_octs != u8) | 270 | if (vendor_def->vendor_type_octs != u8) |
| 271 | { | 271 | { |
| 272 | our_dict_diag_vendor(opts, def, vendor); | 272 | our_dict_diag_vendor(opts, vendor_def, vendor); |
| 273 | return(our_error(opts, NULL, "attribute type octets do not match")); | 273 | return(our_error(opts, NULL, "attribute type octets do not match")); |
| 274 | }; | 274 | }; |
| 275 | 275 | ||
| 276 | // compare vendor len octets | 276 | // compare vendor len octets |
| 277 | tinyrad_dict_vendor_info(vendor, TRAD_DICT_OPT_LEN_OCTS, &u8); | 277 | tinyrad_dict_vendor_info(vendor, TRAD_DICT_OPT_LEN_OCTS, &u8); |
| 278 | if (def->vendor_len_octs != u8) | 278 | if (vendor_def->vendor_len_octs != u8) |
| 279 | { | 279 | { |
| 280 | our_dict_diag_vendor(opts, def, vendor); | 280 | our_dict_diag_vendor(opts, vendor_def, vendor); |
| 281 | return(our_error(opts, NULL, "attribute len octets do not match")); | 281 | return(our_error(opts, NULL, "attribute len octets do not match")); |
| 282 | }; | 282 | }; |
| 283 | 283 | ||
