gecko-dev/xpcom/tests/gtest/TestID.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 строки
1.0 KiB
C++
Исходник Обычный вид История

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2012-05-21 15:12:37 +04:00
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsID.h"
#include "gtest/gtest.h"
static const char* const ids[] = {
"5C347B10-D55C-11D1-89B7-006008911B81",
"{5C347B10-D55C-11D1-89B7-006008911B81}",
"5c347b10-d55c-11d1-89b7-006008911b81",
"{5c347b10-d55c-11d1-89b7-006008911b81}",
"FC347B10-D55C-F1D1-F9B7-006008911B81",
"{FC347B10-D55C-F1D1-F9B7-006008911B81}",
"fc347b10-d55c-f1d1-f9b7-006008911b81",
"{fc347b10-d55c-f1d1-f9b7-006008911b81}",
};
1999-10-22 18:51:41 +04:00
#define NUM_IDS ((int)(sizeof(ids) / sizeof(ids[0])))
TEST(nsID, StringConversion)
{
nsID id;
for (int i = 0; i < NUM_IDS; i++) {
const char* idstr = ids[i];
ASSERT_TRUE(id.Parse(idstr));
char* cp = id.ToString();
ASSERT_NE(cp, nullptr);
ASSERT_STREQ(cp, ids[4 * (i / 4) + 3]);
Backed out 18 changesets (bug 1313469, bug 1313468, bug 1313474, bug 1313472, bug 1313473, bug 1313470, bug 1313471, bug 1313467, bug 1313466) for OS X gtest crashes CLOSED TREE Backed out changeset 5b5686e1bcd1 (bug 1313474) Backed out changeset e8d20bdd13d4 (bug 1313473) Backed out changeset 643bdd25166e (bug 1313473) Backed out changeset 9a33c84ab30a (bug 1313472) Backed out changeset 4d84926813e9 (bug 1313472) Backed out changeset c85e7a7a5a99 (bug 1313471) Backed out changeset 5d82bc9436ab (bug 1313471) Backed out changeset 00f7b342bb29 (bug 1313470) Backed out changeset f012923cfd8b (bug 1313470) Backed out changeset e7d5b8135ae6 (bug 1313470) Backed out changeset 82bf00ff6505 (bug 1313469) Backed out changeset 5364fc8db9b0 (bug 1313469) Backed out changeset 02959aa60196 (bug 1313468) Backed out changeset 3c25a6ed5914 (bug 1313467) Backed out changeset 0acc0a131101 (bug 1313467) Backed out changeset 6fae1bbd3819 (bug 1313467) Backed out changeset 107eb264a40d (bug 1313467) Backed out changeset 9b60e295a885 (bug 1313466) MozReview-Commit-ID: IKsAZxBYMfv --HG-- rename : xpcom/tests/gtest/TestAutoPtr.cpp => xpcom/tests/TestAutoPtr.cpp rename : xpcom/tests/gtest/TestAutoRef.cpp => xpcom/tests/TestAutoRef.cpp rename : xpcom/tests/gtest/TestCOMArray.cpp => xpcom/tests/TestCOMArray.cpp rename : xpcom/tests/gtest/TestCOMPtr.cpp => xpcom/tests/TestCOMPtr.cpp rename : xpcom/tests/gtest/TestCOMPtrEq.cpp => xpcom/tests/TestCOMPtrEq.cpp rename : xpcom/tests/gtest/TestFile.cpp => xpcom/tests/TestFile.cpp rename : xpcom/tests/gtest/TestHashtables.cpp => xpcom/tests/TestHashtables.cpp rename : xpcom/tests/gtest/TestID.cpp => xpcom/tests/TestID.cpp
2016-11-04 09:00:47 +03:00
free(cp);
}
}