michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: #include michael@0: #include "plstr.h" michael@0: #include "nsID.h" michael@0: michael@0: static const char* const ids[] = { michael@0: "5C347B10-D55C-11D1-89B7-006008911B81", michael@0: "{5C347B10-D55C-11D1-89B7-006008911B81}", michael@0: "5c347b10-d55c-11d1-89b7-006008911b81", michael@0: "{5c347b10-d55c-11d1-89b7-006008911b81}", michael@0: michael@0: "FC347B10-D55C-F1D1-F9B7-006008911B81", michael@0: "{FC347B10-D55C-F1D1-F9B7-006008911B81}", michael@0: "fc347b10-d55c-f1d1-f9b7-006008911b81", michael@0: "{fc347b10-d55c-f1d1-f9b7-006008911b81}", michael@0: }; michael@0: #define NUM_IDS ((int) (sizeof(ids) / sizeof(ids[0]))) michael@0: michael@0: int main(int argc, char** argv) michael@0: { michael@0: nsID id; michael@0: for (int i = 0; i < NUM_IDS; i++) { michael@0: const char* idstr = ids[i]; michael@0: if (!id.Parse(idstr)) { michael@0: fprintf(stderr, "TestID: Parse failed on test #%d\n", i); michael@0: return -1; michael@0: } michael@0: char* cp = id.ToString(); michael@0: if (nullptr == cp) { michael@0: fprintf(stderr, "TestID: ToString failed on test #%d\n", i); michael@0: return -1; michael@0: } michael@0: if (0 != PL_strcmp(cp, ids[4*(i/4) + 3])) { michael@0: fprintf(stderr, "TestID: compare of ToString failed on test #%d\n", i); michael@0: return -1; michael@0: } michael@0: } michael@0: michael@0: return 0; michael@0: }