Add -lpthread in addition to -pthread on Linux.
[platform/upstream/glog.git] / src / utilities_unittest.cc
1 // Copyright 2008 Google Inc. All Rights Reserved.
2 // Author: hamaji@google.com (Shinichiro Hamaji)
3
4 #include "utilities.h"
5 #include "googletest.h"
6 #include "glog/logging.h"
7
8 using namespace GOOGLE_NAMESPACE;
9
10 TEST(sync_val_compare_and_swap, utilities) {
11   bool now_entering = false;
12   EXPECT_FALSE(sync_val_compare_and_swap(&now_entering, false, true));
13   EXPECT_TRUE(sync_val_compare_and_swap(&now_entering, false, true));
14   EXPECT_TRUE(sync_val_compare_and_swap(&now_entering, false, true));
15 }
16
17 int main(int argc, char **argv) {
18   InitGoogleLogging(argv[0]);
19
20   CHECK_EQ(RUN_ALL_TESTS(), 0);
21 }