Daniel Carvalho has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/43009 )

Change subject: WIP,base-stats: Add unit test for Stats::Info
......................................................................

WIP,base-stats: Add unit test for Stats::Info

Add a unit test for stats/info.

Change-Id: I8b169d34c1309b37ba79fa9cf6895547b7e97fc0
Signed-off-by: Daniel R. Carvalho <[email protected]>
---
M src/base/stats/SConscript
M src/base/stats/info.cc
M src/base/stats/info.hh
A src/base/stats/info.test.cc
4 files changed, 42 insertions(+), 2 deletions(-)



diff --git a/src/base/stats/SConscript b/src/base/stats/SConscript
index 6981418..702b18b 100644
--- a/src/base/stats/SConscript
+++ b/src/base/stats/SConscript
@@ -40,6 +40,7 @@
     else:
         Source('hdf5.cc')

+GTest('info.test', 'info.test.cc', 'info.cc', '../debug.cc', '../str.cc')
GTest('storage.test', 'storage.test.cc', '../debug.cc', '../str.cc', 'info.cc',
     'storage.cc', '../../sim/cur_tick.cc')
 GTest('units.test', 'units.test.cc')
diff --git a/src/base/stats/info.cc b/src/base/stats/info.cc
index b2ad86b..b2b9b6a 100644
--- a/src/base/stats/info.cc
+++ b/src/base/stats/info.cc
@@ -42,8 +42,6 @@
 #include "base/stats/info.hh"

 #include <cctype>
-#include <map>
-#include <string>

 #include "base/cprintf.hh"
 #include "base/debug.hh"
diff --git a/src/base/stats/info.hh b/src/base/stats/info.hh
index 0568aa4..971a798 100644
--- a/src/base/stats/info.hh
+++ b/src/base/stats/info.hh
@@ -29,6 +29,11 @@
 #ifndef __BASE_STATS_INFO_HH__
 #define __BASE_STATS_INFO_HH__

+#include <cstdint>
+#include <map>
+#include <string>
+#include <vector>
+
 #include "base/flags.hh"
 #include "base/stats/types.hh"
 #include "base/stats/units.hh"
diff --git a/src/base/stats/info.test.cc b/src/base/stats/info.test.cc
new file mode 100644
index 0000000..d76a33c
--- /dev/null
+++ b/src/base/stats/info.test.cc
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2021 Daniel R. Carvalho
+ * All rights reserved
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer;
+ * redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution;
+ * neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <gtest/gtest-spi.h>
+#include <gtest/gtest.h>
+
+#include "base/stats/info.hh"
+
+TEST(StatsInfoTest, Construct)
+{
+}

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/43009
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I8b169d34c1309b37ba79fa9cf6895547b7e97fc0
Gerrit-Change-Number: 43009
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to