/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=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 http://mozilla.org/MPL/2.0/. */
TEST(StorageStreams, Main)
{ // generate some test data we will write in 4k chunks to the stream
nsTArray<char> kData;
testing::CreateData(4096, kData);
// track how much data was written so we can compare at the end
nsAutoCString dataWritten;
rv = out->Close();
EXPECT_NS_SUCCEEDED(rv);
out = nullptr;
// now, read all
rv = stor->NewInputStream(0, getter_AddRefs(in));
EXPECT_NS_SUCCEEDED(rv);
testing::ConsumeAndValidateStream(in, dataWritten);
in = nullptr;
}
TEST(StorageStreams, EarlyInputStream)
{ // generate some test data we will write in 4k chunks to the stream
nsTArray<char> kData;
testing::CreateData(4096, kData);
// track how much data was written so we can compare at the end
nsAutoCString dataWritten;
// Get input stream before writing data into the output stream
nsCOMPtr<nsIInputStream> in;
rv = stor->NewInputStream(0, getter_AddRefs(in));
EXPECT_NS_SUCCEEDED(rv);
// Write data to output stream
nsCOMPtr<nsIOutputStream> out;
rv = stor->GetOutputStream(0, getter_AddRefs(out));
EXPECT_NS_SUCCEEDED(rv);
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.