@@ -24,42 +24,42 @@ namespace battery {
2424class LongArrayMultiStateCounterTest : public testing ::Test {};
2525
2626TEST_F (LongArrayMultiStateCounterTest, stateChange) {
27- LongArrayMultiStateCounter testCounter (2 , std::vector< uint64_t > (4 ));
28- testCounter.updateValue (std::vector< uint64_t > ({0 , 0 , 0 , 0 }), 1000 );
27+ LongArrayMultiStateCounter testCounter (2 , Uint64Array (4 ));
28+ testCounter.updateValue (Uint64ArrayRW ({0 , 0 , 0 , 0 }), 1000 );
2929 testCounter.setState (0 , 1000 );
3030 testCounter.setState (1 , 2000 );
31- testCounter.updateValue (std::vector< uint64_t > ({100 , 200 , 300 , 400 }), 3000 );
31+ testCounter.updateValue (Uint64ArrayRW ({100 , 200 , 300 , 400 }), 3000 );
3232
3333 // Time was split in half between the two states, so the counts will be split 50:50 too
34- EXPECT_EQ (std::vector< uint64_t > ({50 , 100 , 150 , 200 }), testCounter.getCount (0 ));
35- EXPECT_EQ (std::vector< uint64_t > ({50 , 100 , 150 , 200 }), testCounter.getCount (1 ));
34+ EXPECT_EQ (Uint64ArrayRW ({50 , 100 , 150 , 200 }), testCounter.getCount (0 ));
35+ EXPECT_EQ (Uint64ArrayRW ({50 , 100 , 150 , 200 }), testCounter.getCount (1 ));
3636}
3737
3838TEST_F (LongArrayMultiStateCounterTest, accumulation) {
39- LongArrayMultiStateCounter testCounter (2 , std::vector< uint64_t > (4 ));
40- testCounter.updateValue (std::vector< uint64_t > ({0 , 0 , 0 , 0 }), 1000 );
39+ LongArrayMultiStateCounter testCounter (2 , Uint64Array (4 ));
40+ testCounter.updateValue (Uint64ArrayRW ({0 , 0 , 0 , 0 }), 1000 );
4141 testCounter.setState (0 , 1000 );
4242 testCounter.setState (1 , 2000 );
43- testCounter.updateValue (std::vector< uint64_t > ({100 , 200 , 300 , 400 }), 3000 );
43+ testCounter.updateValue (Uint64ArrayRW ({100 , 200 , 300 , 400 }), 3000 );
4444 testCounter.setState (0 , 4000 );
45- testCounter.updateValue (std::vector< uint64_t > ({200 , 300 , 400 , 500 }), 8000 );
45+ testCounter.updateValue (Uint64ArrayRW ({200 , 300 , 400 , 500 }), 8000 );
4646
4747 // The first delta is split 50:50:
4848 // 0: {50, 100, 150, 200}
4949 // 1: {50, 100, 150, 200}
5050 // The second delta is split 4:1
5151 // 0: {80, 80, 80, 80}
5252 // 1: {20, 20, 20, 20}
53- EXPECT_EQ (std::vector< uint64_t > ({130 , 180 , 230 , 280 }), testCounter.getCount (0 ));
54- EXPECT_EQ (std::vector< uint64_t > ({70 , 120 , 170 , 220 }), testCounter.getCount (1 ));
53+ EXPECT_EQ (Uint64ArrayRW ({130 , 180 , 230 , 280 }), testCounter.getCount (0 ));
54+ EXPECT_EQ (Uint64ArrayRW ({70 , 120 , 170 , 220 }), testCounter.getCount (1 ));
5555}
5656
5757TEST_F (LongArrayMultiStateCounterTest, toString) {
58- LongArrayMultiStateCounter testCounter (2 , std::vector< uint64_t > (4 ));
59- testCounter.updateValue (std::vector< uint64_t > ({0 , 0 , 0 , 0 }), 1000 );
58+ LongArrayMultiStateCounter testCounter (2 , Uint64Array (4 ));
59+ testCounter.updateValue (Uint64ArrayRW ({0 , 0 , 0 , 0 }), 1000 );
6060 testCounter.setState (0 , 1000 );
6161 testCounter.setState (1 , 2000 );
62- testCounter.updateValue (std::vector< uint64_t > ({100 , 200 , 300 , 400 }), 3000 );
62+ testCounter.updateValue (Uint64ArrayRW ({100 , 200 , 300 , 400 }), 3000 );
6363
6464 EXPECT_STREQ (" [0: {50, 100, 150, 200}, 1: {50, 100, 150, 200}] updated: 3000 currentState: 1" ,
6565 testCounter.toString ().c_str ());
0 commit comments