Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(324)

Unified Diff: blimp/helium/serializable_struct_unittest.cc

Issue 2602103002: Delete blimp/helium and remove references to it from dependent targets (Closed)
Patch Set: . Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « blimp/helium/serializable_struct.cc ('k') | blimp/helium/stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/helium/serializable_struct_unittest.cc
diff --git a/blimp/helium/serializable_struct_unittest.cc b/blimp/helium/serializable_struct_unittest.cc
deleted file mode 100644
index 9951482ca2026191b1fdd0b2cf71ce885cb250f9..0000000000000000000000000000000000000000
--- a/blimp/helium/serializable_struct_unittest.cc
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <string>
-#include <vector>
-
-#include "base/macros.h"
-#include "blimp/helium/serializable_struct.h"
-#include "blimp/helium/stream_helpers.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/protobuf/src/google/protobuf/io/coded_stream.h"
-#include "third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.h"
-
-namespace blimp {
-namespace helium {
-namespace {
-
-struct EmptyStruct : public SerializableStruct {
- EmptyStruct() {}
- ~EmptyStruct() override {}
-
- private:
- DISALLOW_COPY_AND_ASSIGN(EmptyStruct);
-};
-
-struct TwoFieldStruct : public SerializableStruct {
- TwoFieldStruct() : field_1(this), field_2(this) {}
- ~TwoFieldStruct() override {}
-
- Field<int32_t> field_1;
- Field<int32_t> field_2;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TwoFieldStruct);
-};
-
-class SerializableStructTest : public testing::Test {
- public:
- SerializableStructTest() {}
- ~SerializableStructTest() override = default;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SerializableStructTest);
-};
-
-TEST_F(SerializableStructTest, ByteFormatTwoFieldsSet) {
- TwoFieldStruct test_struct;
- test_struct.field_1.Set(5);
- test_struct.field_2.Set(6);
-
- std::string changeset;
- google::protobuf::io::StringOutputStream raw_output_stream(&changeset);
- google::protobuf::io::CodedOutputStream output_stream(&raw_output_stream);
- test_struct.Serialize(&output_stream);
- output_stream.Trim();
-
- EXPECT_EQ("\x5\x6", changeset);
-}
-
-TEST_F(SerializableStructTest, ByteFormatOneFieldSet) {
- TwoFieldStruct test_struct;
- test_struct.field_2.Set(6);
-
- std::string changeset;
- google::protobuf::io::StringOutputStream raw_output_stream(&changeset);
- google::protobuf::io::CodedOutputStream output_stream(&raw_output_stream);
- test_struct.Serialize(&output_stream);
- output_stream.Trim();
-
- EXPECT_EQ(0x00, changeset[0]);
- EXPECT_EQ(0x06, changeset[1]);
-}
-
-TEST_F(SerializableStructTest, EmptyStruct) {
- EmptyStruct test_struct;
-
- std::string changeset;
- google::protobuf::io::StringOutputStream raw_output_stream(&changeset);
- google::protobuf::io::CodedOutputStream output_stream(&raw_output_stream);
- test_struct.Serialize(&output_stream);
- output_stream.Trim();
-
- EXPECT_TRUE(changeset.empty());
-}
-
-} // namespace
-} // namespace helium
-} // namespace blimp
« no previous file with comments | « blimp/helium/serializable_struct.cc ('k') | blimp/helium/stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698