/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ /* 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 https://mozilla.org/MPL/2.0/. */
char16_t* wchars = nullptr;
EXPECT_EQ(du.ConvertToWString(&wchars), NS_OK);
{ // gtest doesn't seem to support EXPECT_STREQ on char16_t, so convert // to Gecko strings to do the comparison.
nsDependentString wstring(wchars);
EXPECT_EQ(wstring, u"NaN"_ns);
}
free(wchars);
wchars = nullptr;
size = 0;
EXPECT_EQ(du.ConvertToWStringWithSize(&size, &wchars), NS_OK);
{ // gtest doesn't seem to support EXPECT_STREQ on char16_t, so convert // to Gecko strings to do the comparison.
nsDependentString wstring(wchars);
EXPECT_EQ(wstring, u"NaN"_ns);
EXPECT_EQ(size, 3u);
}
free(wchars);
b = true;
du.SetFromInt64(0);
EXPECT_EQ(du.ConvertToBool(&b), NS_OK);
EXPECT_FALSE(b);
b = true;
du.SetFromDouble(1.25);
EXPECT_EQ(du.ConvertToBool(&b), NS_OK);
EXPECT_TRUE(b);
b = true;
du.SetFromDouble(0.0);
EXPECT_EQ(du.ConvertToBool(&b), NS_OK);
EXPECT_FALSE(b);
b = true;
du.SetFromDouble(-0.0);
EXPECT_EQ(du.ConvertToBool(&b), NS_OK);
EXPECT_FALSE(b);
// This is also checked in the previous test, but I'm including it // here for completeness.
b = true;
du.SetFromDouble(NAN);
EXPECT_EQ(du.ConvertToBool(&b), NS_OK);
EXPECT_FALSE(b);
}
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.