Skip to content

Commit d5d47b3

Browse files
committed
fix debug2 tests
1 parent 41e35bc commit d5d47b3

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

src/ptrcheck.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
static std::mutex ptrcheck_mutex;
2424

2525
class PtrcheckHistory;
26-
static std::vector< class PtrcheckHistory * > all_Ptrcheck_history {};
26+
static std::vector< class PtrcheckHistory * > all_history {};
2727

2828
//
2929
// A single event in the life of a pointer.
@@ -40,11 +40,11 @@ class PtrcheckHistory
4040
PtrcheckHistory()
4141
{
4242
ts[ 0 ] = '\0';
43-
all_Ptrcheck_history.push_back(this);
43+
all_history.push_back(this);
4444
}
4545
PtrcheckHistory(const PtrcheckHistory &other) : file(other.file), func(other.func), line(other.line), bt(other.bt)
4646
{
47-
all_Ptrcheck_history.push_back(this);
47+
all_history.push_back(this);
4848

4949
strcpy(ts, other.ts);
5050
}
@@ -743,10 +743,10 @@ static void ptrcheck_fini(int mtype)
743743
return;
744744
}
745745

746-
for (auto *p : all_Ptrcheck_history) {
746+
for (auto *p : all_history) {
747747
delete p;
748748
}
749-
all_Ptrcheck_history.clear();
749+
all_history.clear();
750750

751751
for (i = 0; i < ptrcheck_hash[ mtype ]->hash_size; i++) {
752752
slot = &ptrcheck_hash[ mtype ]->elements[ i ];

src/time.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ static char buf_[ MAXSHORTSTR ];
6060

6161
[[nodiscard]] auto timestamp(char *buf, int len) -> const char *
6262
{
63-
int log_msec = time_ms();
63+
//
64+
// Beware, changing this to time_ms() will have an impact on tests as we use time_ms()
65+
// hacked to a constant time
66+
//
67+
int log_msec = time_ms_cached();
6468
int log_secs = log_msec / ONESEC;
6569
int log_mins = log_secs / 60;
6670
int const log_hrs = log_mins / 60;

0 commit comments

Comments
 (0)