VirtualBox

Changeset 90071 in vbox for trunk


Ignore:
Timestamp:
Jul 6, 2021 4:29:39 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
145566
Message:

Audio/ValKit: Resolved some @todos wrt the test object API. bugref:10008

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/AudioTest.cpp

    r90048 r90071  
    215215*   Internal Functions                                                                                                           *
    216216*********************************************************************************************************************************/
    217 static int  audioTestObjCloseInternal(PAUDIOTESTOBJINT pObj);
     217static int  audioTestObjClose(PAUDIOTESTOBJINT pObj);
    218218static void audioTestObjFinalize(PAUDIOTESTOBJINT pObj);
     219static void audioTestObjInit(PAUDIOTESTOBJINT pObj);
    219220
    220221
     
    827828 *
    828829 * @returns VBox status code.
    829  * @param   phObj               Object handle to get value for.
     830 * @param   pObj               Object handle to get value for.
    830831 * @param   pszKey              Key to get value from.
    831832 * @param   pszVal              Where to return the value on success.
    832833 * @param   cbVal               Size (in bytes) of \a pszVal.
    833834 */
    834 static int audioTestObjGetStr(PAUDIOTESTOBJINT phObj, const char *pszKey, char *pszVal, size_t cbVal)
     835static int audioTestObjGetStr(PAUDIOTESTOBJINT pObj, const char *pszKey, char *pszVal, size_t cbVal)
    835836{
    836837    /** @todo For now we only support .INI-style files. */
    837     AssertPtrReturn(phObj->pSet, VERR_WRONG_ORDER);
    838     return RTIniFileQueryValue(phObj->pSet->f.hIniFile, phObj->szSec, pszKey, pszVal, cbVal, NULL);
     838    AssertPtrReturn(pObj->pSet, VERR_WRONG_ORDER);
     839    return RTIniFileQueryValue(pObj->pSet->f.hIniFile, pObj->szSec, pszKey, pszVal, cbVal, NULL);
    839840}
    840841
     
    843844 *
    844845 * @returns VBox status code.
    845  * @param   phObj               Object handle to get value for.
     846 * @param   pObj               Object handle to get value for.
    846847 * @param   pszKey              Key to get value from.
    847848 * @param   pbVal               Where to return the value on success.
    848849 */
    849 static int audioTestObjGetBool(PAUDIOTESTOBJINT phObj, const char *pszKey, bool *pbVal)
     850static int audioTestObjGetBool(PAUDIOTESTOBJINT pObj, const char *pszKey, bool *pbVal)
    850851{
    851852    char szVal[_1K];
    852     int rc = audioTestObjGetStr(phObj, pszKey, szVal, sizeof(szVal));
     853    int rc = audioTestObjGetStr(pObj, pszKey, szVal, sizeof(szVal));
    853854    if (RT_SUCCESS(rc))
    854855        *pbVal =    (RTStrICmp(szVal, "true") == 0)
     
    862863 *
    863864 * @returns VBox status code.
    864  * @param   phObj               Object handle to get value for.
     865 * @param   pObj               Object handle to get value for.
    865866 * @param   pszKey              Key to get value from.
    866867 * @param   puVal               Where to return the value on success.
    867868 */
    868 static int audioTestObjGetUInt8(PAUDIOTESTOBJINT phObj, const char *pszKey, uint8_t *puVal)
     869static int audioTestObjGetUInt8(PAUDIOTESTOBJINT pObj, const char *pszKey, uint8_t *puVal)
    869870{
    870871    char szVal[_1K];
    871     int rc = audioTestObjGetStr(phObj, pszKey, szVal, sizeof(szVal));
     872    int rc = audioTestObjGetStr(pObj, pszKey, szVal, sizeof(szVal));
    872873    if (RT_SUCCESS(rc))
    873874        *puVal = RTStrToUInt8(szVal);
     
    880881 *
    881882 * @returns VBox status code.
    882  * @param   phObj               Object handle to get value for.
     883 * @param   pObj               Object handle to get value for.
    883884 * @param   pszKey              Key to get value from.
    884885 * @param   puVal               Where to return the value on success.
    885886 */
    886 static int audioTestObjGetUInt32(PAUDIOTESTOBJINT phObj, const char *pszKey, uint32_t *puVal)
     887static int audioTestObjGetUInt32(PAUDIOTESTOBJINT pObj, const char *pszKey, uint32_t *puVal)
    887888{
    888889    char szVal[_1K];
    889     int rc = audioTestObjGetStr(phObj, pszKey, szVal, sizeof(szVal));
     890    int rc = audioTestObjGetStr(pObj, pszKey, szVal, sizeof(szVal));
    890891    if (RT_SUCCESS(rc))
    891892        *puVal = RTStrToUInt32(szVal);
     
    10271028    RTListForEachSafe(&pSet->lstObj, pObj, pObjNext, AUDIOTESTOBJINT, Node)
    10281029    {
    1029         rc = audioTestObjCloseInternal(pObj);
     1030        rc = audioTestObjClose(pObj);
    10301031        if (RT_SUCCESS(rc))
    10311032        {
     
    12361237    RTListForEach(&pSet->lstObj, pObj, AUDIOTESTOBJINT, Node)
    12371238    {
    1238         int rc2 = audioTestObjCloseInternal(pObj);
     1239        int rc2 = audioTestObjClose(pObj);
    12391240        if (RT_SUCCESS(rc2))
    12401241        {
     
    12801281    AssertPtrReturn(pThis, VERR_NO_MEMORY);
    12811282
    1282     RTListInit(&pThis->lstMeta);
     1283    audioTestObjInit(pThis);
    12831284
    12841285    if (RTStrPrintf2(pThis->szName, sizeof(pThis->szName), "%04RU32-%s", pSet->cObj, pszName) <= 0)
     
    14011402    audioTestObjFinalize(pThis);
    14021403
    1403     return audioTestObjCloseInternal(pThis);
     1404    return audioTestObjClose(pThis);
    14041405}
    14051406
     
    17071708
    17081709/**
     1710 * Initializes a test object.
     1711 *
     1712 * @param   pObj                Object to initialize.
     1713 */
     1714static void audioTestObjInit(PAUDIOTESTOBJINT pObj)
     1715{
     1716    RT_BZERO(pObj, sizeof(AUDIOTESTOBJINT));
     1717
     1718    pObj->cRefs = 1;
     1719
     1720    RTListInit(&pObj->lstMeta);
     1721}
     1722
     1723/**
    17091724 * Retrieves a child object of a specific parent object.
    17101725 *
    17111726 * @returns VBox status code.
    1712  * @param   phParent            Parent object the child object contains.
     1727 * @param   pParent             Parent object the child object contains.
    17131728 * @param   idxObj              Index of object to retrieve the object handle for.
    1714  * @param   phObj               Where to store the object handle on success.
    1715  */
    1716 static int audioTestObjGetChild(PAUDIOTESTOBJINT phParent, uint32_t idxObj, PAUDIOTESTOBJINT phObj)
     1729 * @param   pObj                Where to store the object handle on success.
     1730 */
     1731static int audioTestObjGetChild(PAUDIOTESTOBJINT pParent, uint32_t idxObj, PAUDIOTESTOBJINT pObj)
    17171732{
    17181733    char szObj[AUDIOTEST_MAX_SEC_LEN];
     
    17211736
    17221737    char szUuid[AUDIOTEST_MAX_SEC_LEN];
    1723     int rc = audioTestObjGetStr(phParent, szObj, szUuid, sizeof(szUuid));
     1738    int rc = audioTestObjGetStr(pParent, szObj, szUuid, sizeof(szUuid));
    17241739    if (RT_SUCCESS(rc))
    17251740    {
    1726         /** @todo r=bird: see comment in audioTestObjOpen about how reckless it is to
    1727          * leave most of the phObj structure uninitialized. */
    1728 
    1729         if (RTStrPrintf2(phObj->szSec, sizeof(phObj->szSec), "obj_%s", szUuid) <= 0)
    1730             AssertFailedReturn(VERR_BUFFER_OVERFLOW); /** @todo r=bird: AssertReturn(RTStrPrintf2() > 0); results in better code. */
     1741        audioTestObjInit(pObj);
     1742
     1743        AssertReturn(RTStrPrintf2(pObj->szSec, sizeof(pObj->szSec), "obj_%s", szUuid) > 0, VERR_BUFFER_OVERFLOW);
    17311744
    17321745        /** @todo Check test section existence. */
    17331746
    1734         phObj->pSet = phParent->pSet;
     1747        pObj->pSet = pParent->pSet;
    17351748    }
    17361749
     
    17441757 * @returns Error if the verification failed and test verification job has fKeepGoing not set.
    17451758 * @param   pVerJob             Verification job to verify value for.
    1746  * @param   phObjA              Object handle A to verify value for.
    1747  * @param   phObjB              Object handle B to verify value for.
     1759 * @param   pObjA              Object handle A to verify value for.
     1760 * @param   pObjB              Object handle B to verify value for.
    17481761 * @param   pszKey              Key to verify.
    17491762 * @param   pszVal              Value to verify.
     
    17521765 */
    17531766static int audioTestVerifyValue(PAUDIOTESTVERIFYJOB pVerJob,
    1754                                 PAUDIOTESTOBJINT phObjA, PAUDIOTESTOBJINT phObjB, const char *pszKey, const char *pszVal, const char *pszErrFmt, ...)
     1767                                PAUDIOTESTOBJINT pObjA, PAUDIOTESTOBJINT pObjB, const char *pszKey, const char *pszVal, const char *pszErrFmt, ...)
    17551768{
    17561769    va_list va;
     
    17581771
    17591772    char szValA[_1K];
    1760     int rc = audioTestObjGetStr(phObjA, pszKey, szValA, sizeof(szValA));
     1773    int rc = audioTestObjGetStr(pObjA, pszKey, szValA, sizeof(szValA));
    17611774    if (RT_SUCCESS(rc))
    17621775    {
    17631776        char szValB[_1K];
    1764         rc = audioTestObjGetStr(phObjB, pszKey, szValB, sizeof(szValB));
     1777        rc = audioTestObjGetStr(pObjB, pszKey, szValB, sizeof(szValB));
    17651778        if (RT_SUCCESS(rc))
    17661779        {
     
    17911804 *
    17921805 * @returns VBox status code.
    1793  * @param   phObj               Object handle to open.
    1794  * @param   ppObj               Where to return the pointer of the allocated and registered audio test object.
    1795  */
    1796 static int audioTestObjOpen(PAUDIOTESTOBJINT phObj, PAUDIOTESTOBJINT *ppObj)
    1797 {
    1798     /** @todo r=bird: phObj and ppObj: why the 'h' in the first and not the
    1799      * latter? They are of the same type, which is suffixed 'INT', so the 'h'
    1800      * is probably out of place.
    1801      *
    1802      * An immediate question just looking at this function, would why this isn't a
    1803      * 'duplicate' instead of a 'open' operation.  However, looking at how little
    1804      * audioTestObjGetChild actually does to the phObj we're getting from
    1805      * audioTestVerifyTestToneData, it looks more like phObj is just a convenient
    1806      * way of passing a PAUDIOTESTSET and a section name (szSec) around without
    1807      * actually initializing anything else in the structure.
    1808      *
    1809      * This is reckless (7+ uninitialized members) and 'ing confusing code! */
    1810     PAUDIOTESTOBJINT pObj = (PAUDIOTESTOBJINT)RTMemAlloc(sizeof(AUDIOTESTOBJINT));
    1811     AssertPtrReturn(pObj, VERR_NO_MEMORY);
     1806 * @param   pObj                Object to open.
     1807 */
     1808static int audioTestObjOpen(PAUDIOTESTOBJINT pObj)
     1809{
     1810    AssertReturn(pObj->enmType == AUDIOTESTOBJTYPE_UNKNOWN, VERR_WRONG_ORDER);
    18121811
    18131812    char szFileName[AUDIOTEST_MAX_SEC_LEN];
    1814     int rc = audioTestObjGetStr(phObj, "obj_name", szFileName, sizeof(szFileName));
     1813    int rc = audioTestObjGetStr(pObj, "obj_name", szFileName, sizeof(szFileName));
    18151814    if (RT_SUCCESS(rc))
    18161815    {
    18171816        char szFilePath[RTPATH_MAX];
    1818         rc = RTPathJoin(szFilePath, sizeof(szFilePath), phObj->pSet->szPathAbs, szFileName);
     1817        rc = RTPathJoin(szFilePath, sizeof(szFilePath), pObj->pSet->szPathAbs, szFileName);
    18191818        if (RT_SUCCESS(rc))
    18201819        {
     
    18281827
    18291828                pObj->enmType = AUDIOTESTOBJTYPE_FILE;
    1830                 pObj->cRefs   = 1; /* Currently only 1:1 mapping. */
    1831 
    1832                 RTListAppend(&phObj->pSet->lstObj, &pObj->Node);
    1833                 phObj->pSet->cObj++;
    1834 
    1835                 *ppObj = pObj;
    1836                 return VINF_SUCCESS;
    18371829            }
    18381830        }
    18391831    }
    1840 
    1841     RTMemFree(pObj);
    18421832    return rc;
    18431833}
     
    18491839 * @param   pObj                Object to close.
    18501840 */
    1851 static int audioTestObjCloseInternal(PAUDIOTESTOBJINT pObj)
     1841static int audioTestObjClose(PAUDIOTESTOBJINT pObj)
    18521842{
    18531843    int rc;
     
    18861876 *
    18871877 * @returns VBox status code.
    1888  * @param   phObj               Object to retrieve PCM properties for.
     1878 * @param   pObj               Object to retrieve PCM properties for.
    18891879 * @param   pProps              Where to store the PCM properties on success.
    18901880 */
    1891 static int audioTestObjGetTonePcmProps(PAUDIOTESTOBJINT phObj, PPDMAUDIOPCMPROPS pProps)
     1881static int audioTestObjGetTonePcmProps(PAUDIOTESTOBJINT pObj, PPDMAUDIOPCMPROPS pProps)
    18921882{
    18931883    int rc;
    18941884    uint32_t uHz;
    1895     rc = audioTestObjGetUInt32(phObj, "tone_pcm_hz", &uHz);
     1885    rc = audioTestObjGetUInt32(pObj, "tone_pcm_hz", &uHz);
    18961886    AssertRCReturn(rc, rc);
    18971887    uint8_t cBits;
    1898     rc = audioTestObjGetUInt8(phObj, "tone_pcm_bits", &cBits);
     1888    rc = audioTestObjGetUInt8(pObj, "tone_pcm_bits", &cBits);
    18991889    AssertRCReturn(rc, rc);
    19001890    uint8_t cChan;
    1901     rc = audioTestObjGetUInt8(phObj, "tone_pcm_channels", &cChan);
     1891    rc = audioTestObjGetUInt8(pObj, "tone_pcm_channels", &cChan);
    19021892    AssertRCReturn(rc, rc);
    19031893    bool    fSigned;
    1904     rc = audioTestObjGetBool(phObj, "tone_pcm_is_signed", &fSigned);
     1894    rc = audioTestObjGetBool(pObj, "tone_pcm_is_signed", &fSigned);
    19051895    AssertRCReturn(rc, rc);
    19061896
     
    20292019    /** @todo For now ASSUME that we only have one object per test. */
    20302020
    2031     AUDIOTESTOBJINT hObjA;
    2032 
    2033     rc = audioTestObjGetChild(phTestA, 0 /* idxObj */, &hObjA);
     2021    AUDIOTESTOBJINT ObjA;
     2022    rc = audioTestObjGetChild(phTestA, 0 /* idxObj */, &ObjA);
    20342023    CHECK_RC_MSG_MAYBE_RET(rc, pVerJob, "Unable to get object A");
    20352024
    2036     PAUDIOTESTOBJINT pObjA;
    2037     rc = audioTestObjOpen(&hObjA, &pObjA);
     2025    rc = audioTestObjOpen(&ObjA);
    20382026    CHECK_RC_MSG_MAYBE_RET(rc, pVerJob, "Unable to open object A");
    20392027
    2040     AUDIOTESTOBJINT hObjB;
    2041     rc = audioTestObjGetChild(phTestB, 0 /* idxObj */, &hObjB);
     2028    AUDIOTESTOBJINT ObjB;
     2029    rc = audioTestObjGetChild(phTestB, 0 /* idxObj */, &ObjB);
    20422030    CHECK_RC_MSG_MAYBE_RET(rc, pVerJob, "Unable to get object B");
    20432031
    2044     PAUDIOTESTOBJINT pObjB;
    2045     rc = audioTestObjOpen(&hObjB, &pObjB);
     2032    rc = audioTestObjOpen(&ObjB);
    20462033    CHECK_RC_MSG_MAYBE_RET(rc, pVerJob, "Unable to open object B");
    2047     AssertReturn(pObjA->enmType == AUDIOTESTOBJTYPE_FILE, VERR_NOT_SUPPORTED);
    2048     AssertReturn(pObjB->enmType == AUDIOTESTOBJTYPE_FILE, VERR_NOT_SUPPORTED);
    20492034
    20502035    /*
     
    20522037     */
    20532038    uint64_t cbSizeA, cbSizeB;
    2054     rc = RTFileQuerySize(pObjA->File.hFile, &cbSizeA);
    2055     AssertRCReturn(rc, rc);
    2056     rc = RTFileQuerySize(pObjB->File.hFile, &cbSizeB);
     2039    rc = RTFileQuerySize(ObjA.File.hFile, &cbSizeA);
     2040    AssertRCReturn(rc, rc);
     2041    rc = RTFileQuerySize(ObjB.File.hFile, &cbSizeB);
    20572042    AssertRCReturn(rc, rc);
    20582043
    20592044    if (!cbSizeA)
    20602045    {
    2061         int rc2 = audioTestErrorDescAddError(pVerJob->pErr, pVerJob->idxTest, "File '%s' is empty", pObjA->szName);
     2046        int rc2 = audioTestErrorDescAddError(pVerJob->pErr, pVerJob->idxTest, "File '%s' is empty", ObjA.szName);
    20622047        AssertRC(rc2);
    20632048    }
     
    20652050    if (!cbSizeB)
    20662051    {
    2067         int rc2 = audioTestErrorDescAddError(pVerJob->pErr, pVerJob->idxTest, "File '%s' is empty", pObjB->szName);
     2052        int rc2 = audioTestErrorDescAddError(pVerJob->pErr, pVerJob->idxTest, "File '%s' is empty", ObjB.szName);
    20682053        AssertRC(rc2);
    20692054    }
     
    20742059
    20752060        int rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "File '%s' is %zu bytes (%zums)",
    2076                                             pObjA->szName, cbSizeA, PDMAudioPropsBytesToMilli(&pVerJob->PCMProps, cbSizeA));
     2061                                            ObjA.szName, cbSizeA, PDMAudioPropsBytesToMilli(&pVerJob->PCMProps, cbSizeA));
    20772062        AssertRC(rc2);
    20782063        rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "File '%s' is %zu bytes (%zums)",
    2079                                         pObjB->szName, cbSizeB, PDMAudioPropsBytesToMilli(&pVerJob->PCMProps, cbSizeB));
     2064                                        ObjB.szName, cbSizeB, PDMAudioPropsBytesToMilli(&pVerJob->PCMProps, cbSizeB));
    20802065        AssertRC(rc2);
    20812066
    20822067        rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "File '%s' is %u%% (%zu bytes, %zums) %s than '%s'",
    2083                                         pObjA->szName,
     2068                                        ObjA.szName,
    20842069                                        cbSizeA > cbSizeB ? 100 - ((cbSizeB * 100) / cbSizeA) : 100 - ((cbSizeA * 100) / cbSizeB),
    20852070                                        cbDiffAbs, PDMAudioPropsBytesToMilli(&pVerJob->PCMProps, (uint32_t)cbDiffAbs),
    20862071                                        cbSizeA > cbSizeB ? "bigger" : "smaller",
    2087                                         pObjB->szName);
     2072                                        ObjB.szName);
    20882073        AssertRC(rc2);
    20892074    }
     
    20972082    AUDIOTESTFILECMPPARMS FileA;
    20982083    RT_ZERO(FileA);
    2099     FileA.hFile     = pObjA->File.hFile;
    2100     FileA.offStart  = audioTestToneFileFind(pObjA->File.hFile, true /* fFindSilence */, 0 /* uOff */, &ToneParmsA);
    2101     FileA.cbSize    = RT_MIN(audioTestToneFileFind(pObjA->File.hFile, false /* fFindSilence */, FileA.offStart,  &ToneParmsA) + 1,
     2084    FileA.hFile     = ObjA.File.hFile;
     2085    FileA.offStart  = audioTestToneFileFind(ObjA.File.hFile, true /* fFindSilence */, 0 /* uOff */, &ToneParmsA);
     2086    FileA.cbSize    = RT_MIN(audioTestToneFileFind(ObjA.File.hFile, false /* fFindSilence */, FileA.offStart,  &ToneParmsA) + 1,
    21022087                             cbSizeA);
    21032088
     
    21082093    AUDIOTESTFILECMPPARMS FileB;
    21092094    RT_ZERO(FileB);
    2110     FileB.hFile     = pObjB->File.hFile;
    2111     FileB.offStart  = audioTestToneFileFind(pObjB->File.hFile, true /* fFindSilence */, 0 /* uOff */, &ToneParmsB);
    2112     FileB.cbSize    = RT_MIN(audioTestToneFileFind(pObjB->File.hFile, false /* fFindSilence */, FileB.offStart,  &ToneParmsB),
     2095    FileB.hFile     = ObjB.File.hFile;
     2096    FileB.offStart  = audioTestToneFileFind(ObjB.File.hFile, true /* fFindSilence */, 0 /* uOff */, &ToneParmsB);
     2097    FileB.cbSize    = RT_MIN(audioTestToneFileFind(ObjB.File.hFile, false /* fFindSilence */, FileB.offStart,  &ToneParmsB),
    21132098                             cbSizeB);
    21142099
    21152100    Log2Func(("Test #%RU32\n", pVerJob->idxTest));
    2116     Log2Func(("File A ('%s'): cbOff=%RU64  cbSize=%RU64, cbFileSize=%RU64\n", pObjA->szName, FileA.offStart, FileA.cbSize - FileA.offStart, cbSizeA));
    2117     Log2Func(("File B ('%s'): cbOff=%RU64, cbSize=%RU64, cbFileSize=%RU64\n", pObjB->szName, FileB.offStart, FileB.cbSize - FileB.offStart, cbSizeB));
     2101    Log2Func(("File A ('%s'): cbOff=%RU64  cbSize=%RU64, cbFileSize=%RU64\n", ObjA.szName, FileA.offStart, FileA.cbSize - FileA.offStart, cbSizeA));
     2102    Log2Func(("File B ('%s'): cbOff=%RU64, cbSize=%RU64, cbFileSize=%RU64\n", ObjB.szName, FileB.offStart, FileB.cbSize - FileB.offStart, cbSizeB));
    21182103
    21192104    uint32_t const cDiffs = audioTestFilesFindDiffsBinary(&FileA, &FileB, &ToneParmsA);
    21202105
    21212106    int rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "Files '%s' and '%s' are %s (%RU32 different chunks, threshold is %RU32)",
    2122                                         pObjA->szName, pObjB->szName, cDiffs == 0 ? "equal" : "different", cDiffs, pVerJob->cThresholdDiff);
     2107                                        ObjA.szName, ObjB.szName, cDiffs == 0 ? "equal" : "different", cDiffs, pVerJob->cThresholdDiff);
    21232108    AssertRC(rc2);
    21242109
     
    21262111    {
    21272112        rc2 = audioTestErrorDescAddError(pVerJob->pErr, pVerJob->idxTest, "Files '%s' and '%s' do not match",
    2128                                          pObjA->szName, pObjB->szName);
     2113                                         ObjA.szName, ObjB.szName);
    21292114        AssertRC(rc2);
    21302115    }
    21312116
    2132     rc = audioTestObjCloseInternal(pObjA);
    2133     AssertRCReturn(rc, rc);
    2134     rc = audioTestObjCloseInternal(pObjB);
     2117    rc = audioTestObjClose(&ObjA);
     2118    AssertRCReturn(rc, rc);
     2119    rc = audioTestObjClose(&ObjB);
    21352120    AssertRCReturn(rc, rc);
    21362121
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette