11/**
22 * @fileoverview Tests for storage.js.
33 */
4- goog . module ( 'protobuf.binary.StorageTest ' ) ;
4+ goog . module ( 'protobuf.runtime.BinaryStorageTest ' ) ;
55
66goog . setTestOnly ( ) ;
77
8- const Storage = goog . require ( 'protobuf.binary.Storage ' ) ;
8+ const BinaryStorage = goog . require ( 'protobuf.runtime.BinaryStorage ' ) ;
99const { Field} = goog . require ( 'protobuf.binary.field' ) ;
1010
1111/**
@@ -25,7 +25,7 @@ const /** !Field */ field4 =
2525/**
2626 * Returns the number of fields stored.
2727 *
28- * @param {!Storage } storage
28+ * @param {!BinaryStorage } storage
2929 * @return {number }
3030 */
3131function getStorageSize ( storage ) {
@@ -34,9 +34,9 @@ function getStorageSize(storage) {
3434 return size ;
3535}
3636
37- describe ( 'Storage ' , ( ) => {
37+ describe ( 'BinaryStorage ' , ( ) => {
3838 it ( 'sets and gets a field not greater than the pivot' , ( ) => {
39- const storage = new Storage ( DEFAULT_PIVOT ) ;
39+ const storage = new BinaryStorage ( DEFAULT_PIVOT ) ;
4040
4141 storage . set ( 1 , field1 ) ;
4242 storage . set ( DEFAULT_PIVOT , field2 ) ;
@@ -47,7 +47,7 @@ describe('Storage', () => {
4747 } ) ;
4848
4949 it ( 'sets and gets a field greater than the pivot' , ( ) => {
50- const storage = new Storage ( DEFAULT_PIVOT ) ;
50+ const storage = new BinaryStorage ( DEFAULT_PIVOT ) ;
5151
5252 storage . set ( DEFAULT_PIVOT + 1 , field1 ) ;
5353 storage . set ( 100000 , field2 ) ;
@@ -57,7 +57,7 @@ describe('Storage', () => {
5757 } ) ;
5858
5959 it ( 'sets and gets a field when pivot is zero' , ( ) => {
60- const storage = new Storage ( 0 ) ;
60+ const storage = new BinaryStorage ( 0 ) ;
6161
6262 storage . set ( 0 , field1 ) ;
6363 storage . set ( 100000 , field2 ) ;
@@ -68,7 +68,7 @@ describe('Storage', () => {
6868 } ) ;
6969
7070 it ( 'sets and gets a field when pivot is undefined' , ( ) => {
71- const storage = new Storage ( ) ;
71+ const storage = new BinaryStorage ( ) ;
7272
7373 storage . set ( 0 , field1 ) ;
7474 storage . set ( DEFAULT_PIVOT , field2 ) ;
@@ -81,7 +81,7 @@ describe('Storage', () => {
8181 } ) ;
8282
8383 it ( 'returns undefined for nonexistent fields' , ( ) => {
84- const storage = new Storage ( DEFAULT_PIVOT ) ;
84+ const storage = new BinaryStorage ( DEFAULT_PIVOT ) ;
8585
8686 expect ( storage . get ( 1 ) ) . toBeUndefined ( ) ;
8787 expect ( storage . get ( DEFAULT_PIVOT ) ) . toBeUndefined ( ) ;
@@ -91,7 +91,7 @@ describe('Storage', () => {
9191
9292 it ( 'returns undefined for nonexistent fields after map initialization' ,
9393 ( ) => {
94- const storage = new Storage ( DEFAULT_PIVOT ) ;
94+ const storage = new BinaryStorage ( DEFAULT_PIVOT ) ;
9595 storage . set ( 100001 , field1 ) ;
9696
9797 expect ( storage . get ( 1 ) ) . toBeUndefined ( ) ;
@@ -101,7 +101,7 @@ describe('Storage', () => {
101101 } ) ;
102102
103103 it ( 'deletes a field in delete() when values are only in array' , ( ) => {
104- const storage = new Storage ( DEFAULT_PIVOT ) ;
104+ const storage = new BinaryStorage ( DEFAULT_PIVOT ) ;
105105 storage . set ( 1 , field1 ) ;
106106
107107 storage . delete ( 1 ) ;
@@ -111,7 +111,7 @@ describe('Storage', () => {
111111
112112 it ( 'deletes a field in delete() when values are both in array and map' ,
113113 ( ) => {
114- const storage = new Storage ( DEFAULT_PIVOT ) ;
114+ const storage = new BinaryStorage ( DEFAULT_PIVOT ) ;
115115 storage . set ( DEFAULT_PIVOT , field2 ) ;
116116 storage . set ( DEFAULT_PIVOT + 1 , field3 ) ;
117117
@@ -123,7 +123,7 @@ describe('Storage', () => {
123123 } ) ;
124124
125125 it ( 'deletes a field in delete() when values are only in map' , ( ) => {
126- const storage = new Storage ( DEFAULT_PIVOT ) ;
126+ const storage = new BinaryStorage ( DEFAULT_PIVOT ) ;
127127 storage . set ( 100000 , field4 ) ;
128128
129129 storage . delete ( 100000 ) ;
@@ -132,7 +132,7 @@ describe('Storage', () => {
132132 } ) ;
133133
134134 it ( 'loops over all the elements in forEach()' , ( ) => {
135- const storage = new Storage ( DEFAULT_PIVOT ) ;
135+ const storage = new BinaryStorage ( DEFAULT_PIVOT ) ;
136136 storage . set ( 1 , field1 ) ;
137137 storage . set ( DEFAULT_PIVOT , field2 ) ;
138138 storage . set ( DEFAULT_PIVOT + 1 , field3 ) ;
@@ -150,7 +150,7 @@ describe('Storage', () => {
150150 } ) ;
151151
152152 it ( 'creates a shallow copy of the storage in shallowCopy()' , ( ) => {
153- const storage = new Storage ( DEFAULT_PIVOT ) ;
153+ const storage = new BinaryStorage ( DEFAULT_PIVOT ) ;
154154 storage . set ( 1 , field1 ) ;
155155 storage . set ( 100000 , field2 ) ;
156156
0 commit comments