diff --git a/src/tests/kits/app/bpropertyinfo/PropertyConstructionTest1.cpp b/src/tests/kits/app/bpropertyinfo/PropertyConstructionTest1.cpp index 7d9f165a8a..fe52d7512e 100644 --- a/src/tests/kits/app/bpropertyinfo/PropertyConstructionTest1.cpp +++ b/src/tests/kits/app/bpropertyinfo/PropertyConstructionTest1.cpp @@ -1,5 +1,5 @@ /* - $Id: PropertyConstructionTest1.cpp,v 1.6 2002/08/15 04:42:06 jrand Exp $ + $Id: PropertyConstructionTest1.cpp,v 1.7 2002/08/17 05:55:18 jrand Exp $ This file implements the first test for the OpenBeOS BPropertyInfo code. It tests the Construction use cases. It does so by doing the following: @@ -247,7 +247,7 @@ ssize_t flat_size, const char *flat_data) { - char buffer[512]; + char buffer[768]; assert(propTest->CountProperties() == prop_count); assert(propTest->CountValues() == value_count); @@ -261,12 +261,116 @@ assert(propTest->Flatten(buffer, sizeof(buffer)/ sizeof(buffer[0])) == B_OK); assert(memcmp(buffer, flat_data, propTest->FlattenedSize()) == 0); } + + +/* + * Method: PropertyConstructionTest1::CheckFindMatch() + * Descr: This member function performs this test. + */ + + + void PropertyConstructionTest1::CheckFindMatch( + BPropertyInfo *propTest) +{ + const char *uniquePropName = "no match!"; + const uint32 uniqueCommand = 11; + const uint32 uniqueSpecifier = 11; + const char *commonPropName = "test1"; + const uint32 commonCommand = B_GET_PROPERTY; + const uint32 commonSpecifier = B_DIRECT_SPECIFIER; + const uint32 wildcardCommandTests[] = { uniqueCommand, commonCommand, 0}; + const uint32 wildcardSpecifierTests[] = { uniqueSpecifier, commonSpecifier, 0}; + const uint32 *commands; + const uint32 *specifiers; + const property_info *theProps = propTest->Properties(); + int prop_count = propTest->CountProperties(); + int i, j, k; + bool wildcardCommand, wildcardSpec; + + ExecFindMatch(propTest, uniquePropName, uniqueCommand, uniqueSpecifier, false, -1); + ExecFindMatch(propTest, commonPropName, uniqueCommand, uniqueSpecifier, false, -1); + ExecFindMatch(propTest, uniquePropName, commonCommand, uniqueSpecifier, false, -1); + ExecFindMatch(propTest, uniquePropName, uniqueCommand, commonSpecifier, false, -1); + + for (i=0; i < prop_count; i++) { + wildcardCommand = (theProps[i].commands[0] == 0); + wildcardSpec = (theProps[i].specifiers[0] == 0); + if (wildcardCommand) { + commands = wildcardCommandTests; + } else { + commands = theProps[i].commands; + } + if (wildcardSpec) { + specifiers = wildcardSpecifierTests; + } else { + specifiers = theProps[i].specifiers; + } + for(j=0; j<10; j++) { + if (commands[j] == 0) { + break; + } + if (!wildcardSpec) { + ExecFindMatch(propTest, theProps[i].name, commands[j], uniqueSpecifier, + wildcardCommand, -1); + } + for(k=0; k<10; k++) { + if (specifiers[k] == 0) { + break; + } + if (!wildcardCommand) { + ExecFindMatch(propTest, theProps[i].name, uniqueCommand, specifiers[k], + wildcardCommand, -1); + } + ExecFindMatch(propTest, theProps[i].name, commands[j], specifiers[k], + wildcardCommand, i); + } + } + } +} + + +/* + * Method: PropertyConstructionTest1::ExecFindMatch() + * Descr: This member function performs this test. + */ + + + void PropertyConstructionTest1::ExecFindMatch( + BPropertyInfo *propTest, + const char *prop, + uint32 comm, + uint32 spec, + bool wildcardCommand, + int32 result + ) +{ + BMessage msg(comm); + BMessage specMsg(spec); + specMsg.AddString("property", prop); + msg.AddSpecifier(&specMsg); + uint32 extra_data; + + assert(propTest->FindMatch(&msg, 0, &specMsg, spec, prop, &extra_data) == result); + if (result >= 0) { + assert((propTest->Properties())[result].extra_data == extra_data); + } + assert(propTest->FindMatch(&msg, 0, NULL, spec, prop, &extra_data) == result); + if (wildcardCommand) { + assert(propTest->FindMatch(&msg, 1, &specMsg, spec, prop, &extra_data) == result); + assert(propTest->FindMatch(&msg, 1, NULL, spec, prop, &extra_data) == result); + } else { + assert(propTest->FindMatch(&msg, 1, &specMsg, spec, prop, &extra_data) == -1); + assert(propTest->FindMatch(&msg, 1, NULL, spec, prop, &extra_data) == -1); + } +} + + /* * Method: PropertyConstructionTest1::PerformTest() * Descr: This member function performs this test. - */ + */ void PropertyConstructionTest1::PerformTest(void) @@ -277,22 +381,47 @@ int prop_count; int value_count; int flat_size; - char flat_data[300]; + char flat_data[768]; } property_tests; struct property_info prop1[] = { 0 }; struct property_info prop2[] = { - { "duck", {B_GET_PROPERTY, B_SET_PROPERTY, 0}, {B_DIRECT_SPECIFIER, B_INDEX_SPECIFIER, 0}, "get or set duck"}, - { "head", {B_GET_PROPERTY, 0}, {B_DIRECT_SPECIFIER, 0}, "get head"}, - { "head", {B_SET_PROPERTY, 0}, {B_DIRECT_SPECIFIER, 0}, "set head"}, - { "feet", {0}, {0}, "can do anything with his orange feet"}, - 0 // terminate list + { "test1", {B_GET_PROPERTY, B_SET_PROPERTY, B_EXECUTE_PROPERTY, + B_DELETE_PROPERTY, B_CREATE_PROPERTY, B_COUNT_PROPERTIES, 7, + 8, 9, 10}, + {B_DIRECT_SPECIFIER, B_NAME_SPECIFIER, B_ID_SPECIFIER, + B_INDEX_SPECIFIER, B_REVERSE_INDEX_SPECIFIER, + B_RANGE_SPECIFIER, B_REVERSE_RANGE_SPECIFIER, 8, 9, 10}, + "test1: Test maximum property_info", + 0, + {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, + { + { { {"ctype11", 11}, {"ctype12", 12}, {"ctype13", 13}, + {"ctype14", 14}, {"ctype15", 15} } }, + { { {"ctype21", 21}, {"ctype22", 22}, {"ctype23", 23}, + {"ctype24", 24}, {"ctype25", 25} } }, + { { {"ctype31", 31}, {"ctype32", 32}, {"ctype33", 33}, + {"ctype34", 34}, {"ctype35", 35} } } } + }, + { "test2", {0, B_GET_PROPERTY}, + {B_DIRECT_SPECIFIER, 0}, + "test2: Test wildcard command", + 1}, + { "test3", {B_GET_PROPERTY, 0}, + {0, B_DIRECT_SPECIFIER}, + "test3: Test wildcard specifier", + 2}, + { "test4", {0, B_GET_PROPERTY}, + {0, B_DIRECT_SPECIFIER}, + "test4: Test wildcard command and specifier", + 3}, + 0 // terminate list }; struct value_info value1[] = { 0 }; struct value_info value2[] = { - { "Value1", 5, B_COMMAND_KIND, "This is the usage" }, - { "Value2", 6, B_TYPE_CODE_KIND, "This is the usage" }, + { "Value1", 5, B_COMMAND_KIND, "This is the usage", 0 }, + { "Value2", 6, B_TYPE_CODE_KIND, "This is the usage", 1 }, 0 // terminate list }; @@ -307,11 +436,11 @@ {0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5, 0x0, 0x0, 0x0, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x31, 0x0, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x75, 0x73, 0x61, 0x67, 0x65, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x1, 0x0, 0x0, 0x0, 0x6, 0x0, 0x0, 0x0, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x32, 0x0, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, - 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x61, 0x67, 0x65, 0x0, - 0x0, 0x0, 0x0, 0x0} + 0x65, 0x20, 0x75, 0x73, 0x61, 0x67, 0x65, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x1, 0x0, 0x0, 0x0, 0x6, 0x0, 0x0, 0x0, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x32, 0x0, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, + 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x61, 0x67, 0x65, 0x0, 0x1, + 0x0, 0x0, 0x0} }, { prop1, NULL, 0, 0, 9, {0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0} @@ -323,78 +452,167 @@ {0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5, 0x0, 0x0, 0x0, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x31, 0x0, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x75, 0x73, 0x61, 0x67, 0x65, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x1, 0x0, 0x0, 0x0, 0x6, 0x0, 0x0, 0x0, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x32, 0x0, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, - 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x61, 0x67, 0x65, 0x0, - 0x0, 0x0, 0x0, 0x0} + 0x65, 0x20, 0x75, 0x73, 0x61, 0x67, 0x65, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x1, 0x0, 0x0, 0x0, 0x6, 0x0, 0x0, 0x0, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x32, 0x0, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, + 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x61, 0x67, 0x65, 0x0, 0x1, + 0x0, 0x0, 0x0} }, - { prop2, NULL, 4, 0, 212, - {0x0, 0x4, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x64, 0x75, 0x63, - 0x6b, 0x0, 0x67, 0x65, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x73, 0x65, - 0x74, 0x20, 0x64, 0x75, 0x63, 0x6b, 0x0, 0x0, 0x0, 0x0, 0x0, 0x54, - 0x45, 0x47, 0x50, 0x54, 0x45, 0x53, 0x50, 0x0, 0x0, 0x0, 0x0, 0x1, - 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x68, 0x65, - 0x61, 0x64, 0x0, 0x67, 0x65, 0x74, 0x20, 0x68, 0x65, 0x61, 0x64, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x54, 0x45, 0x47, 0x50, 0x0, 0x0, 0x0, - 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x68, 0x65, 0x61, - 0x64, 0x0, 0x73, 0x65, 0x74, 0x20, 0x68, 0x65, 0x61, 0x64, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x54, 0x45, 0x53, 0x50, 0x0, 0x0, 0x0, 0x0, - 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x66, 0x65, 0x65, 0x74, - 0x0, 0x63, 0x61, 0x6e, 0x20, 0x64, 0x6f, 0x20, 0x61, 0x6e, 0x79, - 0x74, 0x68, 0x69, 0x6e, 0x67, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, - 0x68, 0x69, 0x73, 0x20, 0x6f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, - 0x66, 0x65, 0x65, 0x74, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + { prop2, NULL, 4, 0, 570, + {0x0, 0x4, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x74, 0x65, 0x73, + 0x74, 0x31, 0x0, 0x74, 0x65, 0x73, 0x74, 0x31, 0x3a, 0x20, 0x54, + 0x65, 0x73, 0x74, 0x20, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, + 0x20, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x5f, 0x69, + 0x6e, 0x66, 0x6f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x54, 0x45, 0x47, 0x50, + 0x54, 0x45, 0x53, 0x50, 0x45, 0x58, 0x45, 0x50, 0x4c, 0x45, 0x44, + 0x50, 0x54, 0x52, 0x43, 0x50, 0x54, 0x4e, 0x43, 0x50, 0x7, 0x0, + 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x9, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x6, 0x0, 0x0, 0x0, + 0x7, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0, 0x4, + 0x0, 0x0, 0x0, 0x5, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x9, 0x0, + 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x74, 0x65, + 0x73, 0x74, 0x32, 0x0, 0x74, 0x65, 0x73, 0x74, 0x32, 0x3a, 0x20, + 0x54, 0x65, 0x73, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x64, 0x63, 0x61, + 0x72, 0x64, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x0, + 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x74, 0x65, 0x73, 0x74, 0x33, 0x0, 0x74, 0x65, 0x73, + 0x74, 0x33, 0x3a, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x77, 0x69, + 0x6c, 0x64, 0x63, 0x61, 0x72, 0x64, 0x20, 0x73, 0x70, 0x65, 0x63, + 0x69, 0x66, 0x69, 0x65, 0x72, 0x0, 0x2, 0x0, 0x0, 0x0, 0x54, 0x45, + 0x47, 0x50, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x74, 0x65, + 0x73, 0x74, 0x34, 0x0, 0x74, 0x65, 0x73, 0x74, 0x34, 0x3a, 0x20, + 0x54, 0x65, 0x73, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x64, 0x63, 0x61, + 0x72, 0x64, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, + 0x61, 0x6e, 0x64, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, + 0x65, 0x72, 0x0, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, + 0x0, 0x4, 0x0, 0x0, 0x0, 0x5, 0x0, 0x0, 0x0, 0x6, 0x0, 0x0, 0x0, + 0x7, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x9, 0x0, 0x0, 0x0, 0xa, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, 0x65, + 0x31, 0x31, 0x0, 0xb, 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, 0x65, + 0x31, 0x32, 0x0, 0xc, 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, 0x65, + 0x31, 0x33, 0x0, 0xd, 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, 0x65, + 0x31, 0x34, 0x0, 0xe, 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, 0x65, + 0x31, 0x35, 0x0, 0xf, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x63, + 0x74, 0x79, 0x70, 0x65, 0x32, 0x31, 0x0, 0x15, 0x0, 0x0, 0x0, 0x63, + 0x74, 0x79, 0x70, 0x65, 0x32, 0x32, 0x0, 0x16, 0x0, 0x0, 0x0, 0x63, + 0x74, 0x79, 0x70, 0x65, 0x32, 0x33, 0x0, 0x17, 0x0, 0x0, 0x0, 0x63, + 0x74, 0x79, 0x70, 0x65, 0x32, 0x34, 0x0, 0x18, 0x0, 0x0, 0x0, 0x63, + 0x74, 0x79, 0x70, 0x65, 0x32, 0x35, 0x0, 0x19, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, 0x65, 0x33, 0x31, 0x0, 0x1f, + 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, 0x65, 0x33, 0x32, 0x0, 0x20, + 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, 0x65, 0x33, 0x33, 0x0, 0x21, + 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, 0x65, 0x33, 0x34, 0x0, 0x22, + 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, 0x65, 0x33, 0x35, 0x0, 0x23, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0} + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0} }, - { prop2, value1, 4, 0, 214, - {0x0, 0x4, 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0, 0x64, 0x75, 0x63, - 0x6b, 0x0, 0x67, 0x65, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x73, 0x65, - 0x74, 0x20, 0x64, 0x75, 0x63, 0x6b, 0x0, 0x0, 0x0, 0x0, 0x0, 0x54, - 0x45, 0x47, 0x50, 0x54, 0x45, 0x53, 0x50, 0x0, 0x0, 0x0, 0x0, 0x1, - 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x68, 0x65, - 0x61, 0x64, 0x0, 0x67, 0x65, 0x74, 0x20, 0x68, 0x65, 0x61, 0x64, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x54, 0x45, 0x47, 0x50, 0x0, 0x0, 0x0, - 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x68, 0x65, 0x61, - 0x64, 0x0, 0x73, 0x65, 0x74, 0x20, 0x68, 0x65, 0x61, 0x64, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x54, 0x45, 0x53, 0x50, 0x0, 0x0, 0x0, 0x0, - 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x66, 0x65, 0x65, 0x74, - 0x0, 0x63, 0x61, 0x6e, 0x20, 0x64, 0x6f, 0x20, 0x61, 0x6e, 0x79, - 0x74, 0x68, 0x69, 0x6e, 0x67, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, - 0x68, 0x69, 0x73, 0x20, 0x6f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, - 0x66, 0x65, 0x65, 0x74, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + { prop2, value1, 4, 0, 572, + {0x0, 0x4, 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0, 0x74, 0x65, 0x73, 0x74, + 0x31, 0x0, 0x74, 0x65, 0x73, 0x74, 0x31, 0x3a, 0x20, 0x54, 0x65, + 0x73, 0x74, 0x20, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x20, + 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x5f, 0x69, 0x6e, + 0x66, 0x6f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x54, 0x45, 0x47, 0x50, 0x54, + 0x45, 0x53, 0x50, 0x45, 0x58, 0x45, 0x50, 0x4c, 0x45, 0x44, 0x50, + 0x54, 0x52, 0x43, 0x50, 0x54, 0x4e, 0x43, 0x50, 0x7, 0x0, 0x0, 0x0, + 0x8, 0x0, 0x0, 0x0, 0x9, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x6, 0x0, 0x0, 0x0, 0x7, 0x0, + 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, + 0x0, 0x5, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x9, 0x0, 0x0, 0x0, + 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x74, 0x65, 0x73, 0x74, + 0x32, 0x0, 0x74, 0x65, 0x73, 0x74, 0x32, 0x3a, 0x20, 0x54, 0x65, + 0x73, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, 0x64, + 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x0, 0x1, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x74, 0x65, 0x73, 0x74, 0x33, 0x0, 0x74, 0x65, 0x73, 0x74, 0x33, + 0x3a, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x64, + 0x63, 0x61, 0x72, 0x64, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, + 0x69, 0x65, 0x72, 0x0, 0x2, 0x0, 0x0, 0x0, 0x54, 0x45, 0x47, 0x50, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x74, 0x65, 0x73, 0x74, + 0x34, 0x0, 0x74, 0x65, 0x73, 0x74, 0x34, 0x3a, 0x20, 0x54, 0x65, + 0x73, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, 0x64, + 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x6e, + 0x64, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x72, + 0x0, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x1, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0, 0x4, + 0x0, 0x0, 0x0, 0x5, 0x0, 0x0, 0x0, 0x6, 0x0, 0x0, 0x0, 0x7, 0x0, + 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x9, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, 0x65, 0x31, 0x31, + 0x0, 0xb, 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, 0x65, 0x31, 0x32, + 0x0, 0xc, 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, 0x65, 0x31, 0x33, + 0x0, 0xd, 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, 0x65, 0x31, 0x34, + 0x0, 0xe, 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, 0x65, 0x31, 0x35, + 0x0, 0xf, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, + 0x65, 0x32, 0x31, 0x0, 0x15, 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, + 0x65, 0x32, 0x32, 0x0, 0x16, 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, + 0x65, 0x32, 0x33, 0x0, 0x17, 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, + 0x65, 0x32, 0x34, 0x0, 0x18, 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, + 0x65, 0x32, 0x35, 0x0, 0x19, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x63, 0x74, 0x79, 0x70, 0x65, 0x33, 0x31, 0x0, 0x1f, 0x0, 0x0, 0x0, + 0x63, 0x74, 0x79, 0x70, 0x65, 0x33, 0x32, 0x0, 0x20, 0x0, 0x0, 0x0, + 0x63, 0x74, 0x79, 0x70, 0x65, 0x33, 0x33, 0x0, 0x21, 0x0, 0x0, 0x0, + 0x63, 0x74, 0x79, 0x70, 0x65, 0x33, 0x34, 0x0, 0x22, 0x0, 0x0, 0x0, + 0x63, 0x74, 0x79, 0x70, 0x65, 0x33, 0x35, 0x0, 0x23, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0} + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0} }, - { prop2, value2, 4, 2, 288, - {0x0, 0x4, 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0, 0x64, 0x75, 0x63, - 0x6b, 0x0, 0x67, 0x65, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x73, 0x65, - 0x74, 0x20, 0x64, 0x75, 0x63, 0x6b, 0x0, 0x0, 0x0, 0x0, 0x0, 0x54, - 0x45, 0x47, 0x50, 0x54, 0x45, 0x53, 0x50, 0x0, 0x0, 0x0, 0x0, 0x1, - 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x68, 0x65, - 0x61, 0x64, 0x0, 0x67, 0x65, 0x74, 0x20, 0x68, 0x65, 0x61, 0x64, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x54, 0x45, 0x47, 0x50, 0x0, 0x0, 0x0, - 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x68, 0x65, 0x61, - 0x64, 0x0, 0x73, 0x65, 0x74, 0x20, 0x68, 0x65, 0x61, 0x64, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x54, 0x45, 0x53, 0x50, 0x0, 0x0, 0x0, 0x0, - 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x66, 0x65, 0x65, 0x74, - 0x0, 0x63, 0x61, 0x6e, 0x20, 0x64, 0x6f, 0x20, 0x61, 0x6e, 0x79, - 0x74, 0x68, 0x69, 0x6e, 0x67, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, - 0x68, 0x69, 0x73, 0x20, 0x6f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, - 0x66, 0x65, 0x65, 0x74, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + { prop2, value2, 4, 2, 646, + {0x0, 0x4, 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0, 0x74, 0x65, 0x73, 0x74, + 0x31, 0x0, 0x74, 0x65, 0x73, 0x74, 0x31, 0x3a, 0x20, 0x54, 0x65, + 0x73, 0x74, 0x20, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x20, + 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x5f, 0x69, 0x6e, + 0x66, 0x6f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x54, 0x45, 0x47, 0x50, 0x54, + 0x45, 0x53, 0x50, 0x45, 0x58, 0x45, 0x50, 0x4c, 0x45, 0x44, 0x50, + 0x54, 0x52, 0x43, 0x50, 0x54, 0x4e, 0x43, 0x50, 0x7, 0x0, 0x0, 0x0, + 0x8, 0x0, 0x0, 0x0, 0x9, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x6, 0x0, 0x0, 0x0, 0x7, 0x0, + 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, + 0x0, 0x5, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x9, 0x0, 0x0, 0x0, + 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x74, 0x65, 0x73, 0x74, + 0x32, 0x0, 0x74, 0x65, 0x73, 0x74, 0x32, 0x3a, 0x20, 0x54, 0x65, + 0x73, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, 0x64, + 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x0, 0x1, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x74, 0x65, 0x73, 0x74, 0x33, 0x0, 0x74, 0x65, 0x73, 0x74, 0x33, + 0x3a, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x64, + 0x63, 0x61, 0x72, 0x64, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, + 0x69, 0x65, 0x72, 0x0, 0x2, 0x0, 0x0, 0x0, 0x54, 0x45, 0x47, 0x50, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x74, 0x65, 0x73, 0x74, + 0x34, 0x0, 0x74, 0x65, 0x73, 0x74, 0x34, 0x3a, 0x20, 0x54, 0x65, + 0x73, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, 0x64, + 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x6e, + 0x64, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x72, + 0x0, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x1, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0, 0x4, + 0x0, 0x0, 0x0, 0x5, 0x0, 0x0, 0x0, 0x6, 0x0, 0x0, 0x0, 0x7, 0x0, + 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x9, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, 0x65, 0x31, 0x31, + 0x0, 0xb, 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, 0x65, 0x31, 0x32, + 0x0, 0xc, 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, 0x65, 0x31, 0x33, + 0x0, 0xd, 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, 0x65, 0x31, 0x34, + 0x0, 0xe, 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, 0x65, 0x31, 0x35, + 0x0, 0xf, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, + 0x65, 0x32, 0x31, 0x0, 0x15, 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, + 0x65, 0x32, 0x32, 0x0, 0x16, 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, + 0x65, 0x32, 0x33, 0x0, 0x17, 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, + 0x65, 0x32, 0x34, 0x0, 0x18, 0x0, 0x0, 0x0, 0x63, 0x74, 0x79, 0x70, + 0x65, 0x32, 0x35, 0x0, 0x19, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x63, 0x74, 0x79, 0x70, 0x65, 0x33, 0x31, 0x0, 0x1f, 0x0, 0x0, 0x0, + 0x63, 0x74, 0x79, 0x70, 0x65, 0x33, 0x32, 0x0, 0x20, 0x0, 0x0, 0x0, + 0x63, 0x74, 0x79, 0x70, 0x65, 0x33, 0x33, 0x0, 0x21, 0x0, 0x0, 0x0, + 0x63, 0x74, 0x79, 0x70, 0x65, 0x33, 0x34, 0x0, 0x22, 0x0, 0x0, 0x0, + 0x63, 0x74, 0x79, 0x70, 0x65, 0x33, 0x35, 0x0, 0x23, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x5, 0x0, 0x0, 0x0, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x31, 0x0, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, - 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x61, 0x67, 0x65, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x6, 0x0, 0x0, 0x0, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x32, 0x0, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, - 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x61, 0x67, 0x65, - 0x0, 0x0, 0x0, 0x0, 0x0} + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5, + 0x0, 0x0, 0x0, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x31, 0x0, 0x54, 0x68, + 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, + 0x73, 0x61, 0x67, 0x65, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, + 0x6, 0x0, 0x0, 0x0, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x32, 0x0, 0x54, + 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, + 0x75, 0x73, 0x61, 0x67, 0x65, 0x0, 0x1, 0x0, 0x0, 0x0} } }; int i; @@ -407,6 +625,7 @@ CheckProperty(propTest, theTests[i].props, theTests[i].values, theTests[i].prop_count, theTests[i].value_count, theTests[i].flat_size, theTests[i].flat_data); + CheckFindMatch(propTest); delete propTest; propPtr = DuplicateProperties(theTests[i].props, theTests[i].prop_count); @@ -415,6 +634,7 @@ CheckProperty(propTest, theTests[i].props, theTests[i].values, theTests[i].prop_count, theTests[i].value_count, theTests[i].flat_size, theTests[i].flat_data); + CheckFindMatch(propTest); delete propTest; propTest = new BPropertyInfo; @@ -423,6 +643,7 @@ CheckProperty(propTest, theTests[i].props, theTests[i].values, theTests[i].prop_count, theTests[i].value_count, theTests[i].flat_size, theTests[i].flat_data); + CheckFindMatch(propTest); delete propTest; } } diff --git a/src/tests/kits/app/bpropertyinfo/PropertyConstructionTest1.h b/src/tests/kits/app/bpropertyinfo/PropertyConstructionTest1.h index 968334b25c..d91af8d05e 100644 --- a/src/tests/kits/app/bpropertyinfo/PropertyConstructionTest1.h +++ b/src/tests/kits/app/bpropertyinfo/PropertyConstructionTest1.h @@ -1,5 +1,5 @@ /* - $Id: PropertyConstructionTest1.h,v 1.4 2002/08/15 04:42:06 jrand Exp $ + $Id: PropertyConstructionTest1.h,v 1.5 2002/08/17 05:55:18 jrand Exp $ This file defines a class for performing one test of BPropertyInfo functionality. @@ -26,12 +26,19 @@ private: int32 value_count, ssize_t flat_size, const char *flat_data); + void CheckFindMatch(BPropertyInfo *propTest); void CompareProperties(const property_info *prop1, const property_info *prop2, int prop_count); void CompareValues(const value_info *value1, const value_info *value2, int value_count); + void ExecFindMatch(BPropertyInfo *propTest, + const char *prop, + uint32 comm, + uint32 spec, + bool wildcardCommand, + int32 result); property_info *DuplicateProperties(const property_info *prop1, int prop_count); value_info *DuplicateValues(const value_info *value1, int value_count);